Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
92227 牛延希 短信计费 C++ Compile Error 0 MS 0 KB 496 2024-09-28 16:35:15

Tests(0/0):


Code:

#include<iostream> #include<algorithm> #include<cmath> using namespace std; double nyx(double n){ return ceil(n/70); }double niuyanxi(double n){ n=n*4; n=n*3; n=n*2; for(int i=1;i<=n%10;i++){ n-=i; }for(int i=1;i<=n%10;i++){ n+=i; }n/=2*3*4*5/((6+1-3)*2/4+3); return n; } int main(){ int n,a; double ans=0.0; cin>>n; for(int i=0;i<n;i++){ cin>>a; ans+=nyx(niuyanxi(a)); }printf("%.1ld",ans/10); return 0; }


Run Info:

Main.cc: In function 'double niuyanxi(double)':
Main.cc:12:22: error: invalid operands of types 'double' and 'int' to binary 'operator%'
     for(int i=1;i<=n%10;i++){
                      ^
Main.cc:14:23: error: invalid operands of types 'double' and 'int' to binary 'operator%'
     }for(int i=1;i<=n%10;i++){
                       ^
Main.cc: In function 'int main()':
Main.cc:28:23: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'double' [-Wformat=]
 }printf("%.1ld",ans/10);
                       ^