QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#860216 | #9675. 电池检测 | Grain_Depot08 | Compile Error | / | / | C++14 | 459b | 2025-01-18 11:21:18 | 2025-01-18 11:21:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int t,a,b;
int main(){
scanf("%d",&t);
while(t--){
scanf("%d%d",&a,&b);
if(a==2)printf("%d\n",(a+b)*(a+b-1)/2);
else if(a==3){
if(b==1)printf("2\n");
else printf("%d\n",3+(a+b-3)*(a+b-4)/2);
}else if(a>b){
if(a>b+1)pritnf("%d\n",b+1);
else printf("%d\n",a-2+(b-a+4)*(b-a+3)/2);
}
}
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:13:22: error: ‘pritnf’ was not declared in this scope; did you mean ‘printf’? 13 | if(a>b+1)pritnf("%d\n",b+1); | ^~~~~~ | printf answer.code:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | scanf("%d",&t); | ~~~~~^~~~~~~~~ answer.code:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d",&a,&b); | ~~~~~^~~~~~~~~~~~~~