7 条题解
-
1邓梓昊 LV 7 @ 2024-11-20 13:13:18
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define int long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int a, ans; char c; signed main() { scanf("%lld ", &a); c = getchar();//字符专用输入方式 if(a < 1001)//判断重量是否在1000以内 ans = 8; else ans = 8 + ((a - 1000) / 500 + 1) * 4; if(c == 'y')//判断是否加急 ans += 5; printf("%lld\n", ans); return 0; }
纯享版:
#include <stdio.h> int a, ans; char c; signed main() { scanf("%lld ", &a); c = getchar(); if(a < 1001) ans = 8; else ans = 8 + ((a - 1000) / 500 + 1) * 4; if(c == 'y') ans += 5; printf("%lld\n", ans); return 0; }
-
02023-9-2 16:07:57@
#include <iostream> #include <cmath> using namespace std; int main() { double n,m; char a; cin>>n>>a; if(n<=1000) { m=8; } else { m=ceil((n-1000)/500)*4+8; } if (a =='y') { m=m+5; } cout << m; return 0; }
-
-12023-3-15 19:54:09@
#include<iostream> #include<cmath> using namespace std; int main(void){ double n,m; char a; cin>>n>>a; if(n<=1000){ m=8; } else{ m=ceil((n-1000)/500)*4+8; } if (a =='y'){ m=m+5; } cout << m; return 0; }
-
-22023-4-1 17:18:36@
#include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() {
double n,m; char a; cin>>n>>a; if(n<=1000) { m=8; } else { m=ceil((n-1000)/500)*4+8; } if (a =='y') { m=m+5; } cout << m; return 0;
}
-
-22023-3-15 19:58:25@
#include<iostream> #include<cmath> using namespace std; int main(void) { double n,m; char a; cin>>n>>a; if(n<=1000){ m=8; } else{ m=ceil((n-1000)/500)*4+8; } if (a =='y'){ m=m+5; } cout << m; return 0; }
-
-22023-3-15 19:57:22@
#include<iostream> #include<cmath> using namespace std; int main(void){ double n,m; char a; cin>>n>>a; if(n<=1000){ m=8; } else{ m=ceil((n-1000)/500)*4+8; } if (a =='y'){ m=m+5; } cout << m; return 0; }
-
-22023-3-15 19:57:02@
#include<iostream> #include<cmath> using namespace std; int main(void){ double n,m; char a; cin>>n>>a; if(n<=1000){ m=8; } else{ m=ceil((n-1000)/500)*4+8; } if (a =='y'){ m=m+5; } cout << m; return 0; }
- 1
信息
- ID
- 2910
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 5
- 标签
- 递交数
- 263
- 已通过
- 86
- 上传者