foo.c: In function 'main':
foo.c:7:12: error: 'cout' undeclared (first use in this function)
7 | cout<<"请输入一个大于0的整数:"<<endl;
| ^~~~
foo.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
foo.c:7:44: error: 'endl' undeclared (first use in this function)
7 | cout<<"请输入一个大于0的整数:"<<endl;
| ^~~~
foo.c:8:12: error: 'cin' undeclared (first use in this function)
8 | cin>>n;
| ^~~
foo.c:9:15: error: expected ';' before 'while'
9 | t=n
| ^
| ;
10 | while(n!=0)
| ~~~~~
foo.c:15:12: error: expected declaration or statement at end of input
15 | cout<<"整数"<<t>>"的各位数之和是:"<<sum\
| ^~~~
foo.c:5:17: warning: variable 'sum' set but not used [-Wunused-but-set-variable]
5 | int n,t,sum;
| ^~~
foo.c:5:15: warning: variable 't' set but not used [-Wunused-but-set-variable]
5 | int n,t,sum;
| ^
[Hydro](https://hydro.ac)提供评测服务