| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 146495 | 孔声豪 | 各个位数之和 | C++ | Compile Error | 0 MS | 0 KB | 159 | 2026-01-29 10:40:09 |
#include<iostream> using namespace std; int main{ int n,m; m=0; cin>>n; while(n!=0){ m+=n%10; n/=10; } cout<<m<<endl; return 0; }
Main.cc:4:1: error: expected primary-expression before 'int'
int n,m;
^
Main.cc:4:1: error: expected '}' before 'int'
Main.cc:4:1: error: expected ',' or ';' before 'int'
Main.cc:5:1: error: 'm' does not name a type
m=0;
^
Main.cc:6:1: error: 'cin' does not name a type
cin>>n;
^
Main.cc:7:1: error: expected unqualified-id before 'while'
while(n!=0){
^
Main.cc:11:1: error: 'cout' does not name a type
cout<