Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 4472922
- Created at: Sat May 21 2022 10:57:01 GMT+0800 (China Standard Time)
- Problem: 5789 Time: 5 Memory: 1680
- */
- /*
- Author: 徐思璐(49859)
- Result: WA Submission_id: 4472841
- Created at: Sat May 21 2022 10:50:15 GMT+0800 (China Standard Time)
- Problem: 5789 Time: 4 Memory: 1748
- */
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include<math.h>
- #include<ctype.h>
- int main()
- {
- FILE* fp;
- int op;
- fp = freopen("301.txt", "a",stdout);
- int n, i;
- scanf("%d", &n);
- for (i = 0; i < n; i++) {
- scanf("%d", &op);
- if (op == 1) {
- int a, b;
- scanf("%d%d", &a, &b);
- printf("%d\n", a + b);
- }
- else if (op==2) {
- long long a, b;
- scanf("%lld%lld", &a, &b);
- printf("%lld\n", a + b);
- }
- else {
- double a, b;
- scanf("%lf%lf", &a, &b);
- printf("%.5f\n", a + b);
- }
- }
- fclose(fp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment