QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#191195 | #7534. KPI Calculation | Days_of_Future_Past# | Compile Error | / | / | C++14 | 438b | 2023-09-29 20:16:07 | 2023-09-29 20:16:07 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1001111;
int main(){
static char st[N];
int ans = 0;
for(;;) {
if(gets(st) == NULL) {
break;
}
int pos = -1;
int len = strlen(st);
int cnt = 0;
for(int i = 0; i < len; i++) {
if(st[i] == ' ') {
cnt++;
}
if(st[i] > ' ') {
pos = i;
break;
}
}
if(pos != -1) {
ans += cnt;
}
}
printf("%d\n", ans);
}
Details
answer.code: In function ‘int main()’: answer.code:8:20: error: ‘gets’ was not declared in this scope; did you mean ‘getw’? 8 | if(gets(st) == NULL) { | ^~~~ | getw