mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-06-04 02:21:15 +08:00
init
This commit is contained in:
+10
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
hello, World!hello, World1!hello, World1!
|
||||
+17
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
char* a= "I love China!";
|
||||
a = a+7;
|
||||
printf("%s\n",a);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
// 无限循环
|
||||
@@ -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