Accepted
foo.cc:2:207: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 2 | using namespace std;int a,h,m,s,t,b,c,d,e;string str;void p(int f,int g,int h,int k){b=abs((f*k)-(h*g));c=__gcd(b,g*k);d=b/c;e=g*k/c;if(e*180<d)d=e*360-d;if(e-1)cout<<d<<"/"<<e<<" ";else cout<<d<<" ";}main(){cin>>a;while(a--){scanf("%d:%d:%d",&h,&m,&s);h%=12;t=h*3600+m*60+s;p(t,120,t%3600,10);p(t,120,s*6,1);p(t%3600,10,s*6,1);cout<<endl;}} | ^ foo.cc: In function 'int main()': foo.cc:2:232: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] 2 | using namespace std;int a,h,m,s,t,b,c,d,e;string str;void p(int f,int g,int h,int k){b=abs((f*k)-(h*g));c=__gcd(b,g*k);d=b/c;e=g*k/c;if(e*180<d)d=e*360-d;if(e-1)cout<<d<<"/"<<e<<" ";else cout<<d<<" ";}main(){cin>>a;while(a--){scanf("%d:%d:%d",&h,&m,&s);h%=12;t=h*3600+m*60+s;p(t,120,t%3600,10);p(t,120,s*6,1);p(t%3600,10,s*6,1);cout<<endl;}} | ~~~~~^~~~~~~~~~~~~~~~~~~~~
Found 10 testcases.
您没有权限查看该代码,完成本题后再来查看
信息
- 递交者
- 类型
- 挑战模式
- 码字时长
- 36.796 秒
- 平均速度
- 0.0 字/秒
- 题目
- S2926 时钟 ( 原题链接 )
- 比赛
- 20210612模拟赛
- 语言
- C++14
- 递交时间
- 2021-06-12 21:18:30
- 评测时间
- 2021-06-12 21:18:30
- 评测机
- 分数
- 100
- 总耗时
- 33ms
- 峰值内存
- 432.0 KiB