Information
- ID
- 23
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 7
- Tags
- # Submissions
- 977
- Accepted
- 242
- Uploaded By
#include <iostream>
using namespace std;
int main()
{
int T = 0;
cin >> T;
while(T--)
{
int n =0;
cin >> n;
if(n<60) cout << "0.0" << endl;
else
{
double d = 1.0 * (n-60)/10+1;
printf("%.1f", d);
printf("\n");
}
}
return 0;
}
#include<iostream>
#include<iomanip> // --->setprecision所需头文件
using namespace std;
int main(){
int T, n;
double ans;
cin >> T;
for(int i = 1; i <= T; i++){
cin >> n;
if(n < 60)
cout << "0.0" << endl;
else{
ans = 1.0 * (n - 60) / 10 + 1;
cout << setprecision(1) << fixed<< ans << endl; //保留一位小数
}
}
return 0;
}
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.