Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
2760 | A班-何泓霏 | 班级就餐 | C++ | 通过 | 100 | 4 MS | 264 KB | 538 | 2024-12-21 12:01:06 |
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int a[n]; int temp=0; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { if(a[i]==1) { cout<<40<<endl; } else if(a[i]==2) { cout<<70<<endl; } else if(a[i]>=3) { int temp=a[i]/3; int sum=a[i]%3; if(sum == 0) { cout<<temp*90<<endl; } else if(sum==1) { cout<<temp*90+40<<endl; } else if (sum==2) { cout<<temp*90+70<<endl; } } } return 0; }