/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:29:100: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::string* {aka std::basic_string<char>*}' [-Wformat=]
         scanf("%s%d%d%c%c%d",&a[i].name,&a[i].qimo,&a[i].banji,&a[i].bangan,&a[i].xibu,&a[i].lunwen);
                                                                                                    ^
foo.cpp:49:26: error: cannot pass objects of non-trivially-copyable type 'std::string {aka class std::basic_string<char>}' through '...'
     printf("%s",a[0].name)
                          ^
foo.cpp:49:26: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'std::string {aka std::basic_string<char>}' [-Wformat=]
foo.cpp:50:5: error: expected ';' before 'cout'
     cout<<endl<<a[0].jiangxuejin<<endl<<zjj;
     ^

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C++
递交时间
2015-07-22 20:57:19
评测时间
2015-07-22 20:57:25
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes