foo.c: In function 'main':
foo.c:5:16: error: stray '\357' in program
scanf("%d",&n);
^
foo.c:5:17: error: stray '\274' in program
scanf("%d",&n);
^
foo.c:5:18: error: stray '\211' in program
scanf("%d",&n);
^
foo.c:5:19: error: stray '\357' in program
scanf("%d",&n);
^
foo.c:5:20: error: stray '\274' in program
scanf("%d",&n);
^
foo.c:5:21: error: stray '\233' in program
scanf("%d",&n);
^
foo.c:6:3: error: expected ')' before 'for'
for(i=1;i++)
^~~
foo.c:8:5: error: invalid suffix "n" on integer constant
n=3n+1;
^~
foo.c:16:1: error: expected ';' before '}' token
}
^
foo.c:4:7: warning: unused variable 'i' [-Wunused-variable]
{ int i,n;
^
foo.c:5:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&n);
^~~~~~~~~~~~~~~~~~~~
for(i=1;i++)
~~~~~~~~~~~~~
{ if(n%2!=0)
~~~~~~~~~~~~~
n=3n+1;
~~~~~~~~
else
~~~~~
n=n/2;
~~~~~~~
if(n==1)
~~~~~~~~~
break;
~~~~~~~
}
~~
printf("%d",i);
~~~~~~~~~~~~~~~~~
return 0;
~~~~~~~~~~
}
~
[Hydro](https://hydro.ac)提供评测服务