mirror of
https://git.wolves.top/wolves/leetcode.git
synced 2025-11-04 09:16:32 +08:00
init
This commit is contained in:
10
test/a_i.c
Normal file
10
test/a_i.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
int main(void){
|
||||
int a[10],i;
|
||||
for (i = 1; i <= 10; i++)
|
||||
{
|
||||
a[i]=0;
|
||||
printf("%d\n",i);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
1
test/example.txt
Normal file
1
test/example.txt
Normal file
@@ -0,0 +1 @@
|
||||
hello, World!hello, World1!hello, World1!
|
||||
17
test/file.c
Normal file
17
test/file.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(){
|
||||
FILE *fp = fopen("example.txt","r+");
|
||||
if(fp == NULL){
|
||||
printf("error,cannot open file");
|
||||
return 1;
|
||||
}
|
||||
char buffer[100];
|
||||
fread(buffer,sizeof(char),100,fp);
|
||||
printf("%s\n",buffer);
|
||||
char *wt = "hello, World1!";
|
||||
fwrite(wt,sizeof(char),strlen(wt),fp);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
7
test/test1.c
Normal file
7
test/test1.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
char* a= "I love China!";
|
||||
a = a+7;
|
||||
printf("%s\n",a);
|
||||
}
|
||||
10
test/test2.c
Normal file
10
test/test2.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int i,j;
|
||||
i = 16;
|
||||
j = (i++)+i;
|
||||
printf("%d\n",j);
|
||||
i = 15;
|
||||
printf("%d %d\n",++i,i);
|
||||
}
|
||||
10
test/test3.c
Normal file
10
test/test3.c
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int i;
|
||||
char *s = "a\045+45\'b";
|
||||
for(i=0;s++;i++);
|
||||
printf("%d\n",i);
|
||||
}
|
||||
|
||||
// 无限循环
|
||||
6
test/test3305.c
Normal file
6
test/test3305.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "../2025/03/3305.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
printf("%d\n",countOfSubstrings("ieaouqqieaouqq",1));
|
||||
}
|
||||
Reference in New Issue
Block a user