[ create a new paste ] login | about

Link: http://codepad.org/BeuVv2Nf    [ raw code | output | fork ]

C, pasted on Jun 29:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
char jinsu2[1000]={0},*s;
s=(char*)malloc(sizeof(char)*1000);
void main(){
char *s,l[3]={0},r,size,jinsu2[1000]={0},jinsu=0;
fgets(s,1000,stdin);
strcpy(s,"73"); size=strlen(s);*l=0;while(*l<size){s[*l]-=48;++*l;}
while(1){
r=*l=0;
char result=0,v;
while(*l<size){
if(s[*l]>0){result=1;}
v=s[*l]; s[*l]=(r+s[*l])/2; r=v%2>0?10:0;
++*l;
 }
 if(result<1){if(jinsu<1){puts("0");}while(jinsu>0){printf("%d",jinsu2[--jinsu]);}break;}
 jinsu2[jinsu]=r>0?1:0;++jinsu;
 }
}


Output:
1
2
3
4
5
6
7
8
9
10
Line 2: warning: data definition has no type or storage class
Line 2: error: conflicting types for 's'
Line 1: error: previous declaration of 's' was here
Line 2: warning: incompatible implicit declaration of built-in function 'malloc'
Line 2: warning: initialization makes integer from pointer without a cast
Line 2: error: initializer element is not constant
In function 'main':
Line 6: warning: incompatible implicit declaration of built-in function 'strcpy'
Line 6: warning: incompatible implicit declaration of built-in function 'strlen'
Line 3: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: