Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
144018 徐景一 过生日 C++ Compile Error 0 MS 0 KB 526 2026-01-18 15:30:13

Tests(0/0):


Code:

#include <iostream> using namespace std; int main(){ int Y,T; int a[1000],n[1000],i; cin>>T; for(i=0;i<T;i++){ cin>>a[i]>>n[i]; } for(i=0;i<T;i++){ if(a[i]%4==0){ a[i]+4*(n-1); }else if((a[i]+1)%4==0){ a[i]+1+4*(n-1); }else if((a[i]+2)%4==0){ a[i]+2+4*(n-1); }else if((a[i]+3)%4==0){ a[i]+3+4*(n-1); } } for(i=0;i<T;i++){ cout<<a[i] } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:24: error: invalid operands of types 'int' and 'int*' to binary 'operator*'
             a[i]+4*(n-1);
                        ^
Main.cc:14:26: error: invalid operands of types 'int' and 'int*' to binary 'operator*'
             a[i]+1+4*(n-1);
                          ^
Main.cc:16:26: error: invalid operands of types 'int' and 'int*' to binary 'operator*'
             a[i]+2+4*(n-1);
                          ^
Main.cc:18:26: error: invalid operands of types 'int' and 'int*' to binary 'operator*'
             a[i]+3+4*(n-1);
                          ^
Main.cc:23:5: error: expected ';' before '}' token
     }    
     ^
Main.cc:4:9: warning: unused variable 'Y' [-Wunused-variable]
     int Y,T;
         ^