1
#include<stdio.h> #include<stdlib.h> int main() { printf("0\n"); printf("<H>\n"); printf("I I\n"); printf("0\n"); printf("<H>\n"); printf("I I\n"); system("pause"); return 0; }
#include<stdio.h>
#include<stdlib.h>
int main()
{
printf(" 0 0\n");
printf("<H> <H>\n");
printf("I I I I\n");
system("pause");
return 0;
}
2
#include <stdio.h> #include <math.h> int main() { double x, ans; while (scanf_s("%lf", &x) != EOF) { ans = pow(x, 365); printf("%.2f的365次方:%.2f\n", x, ans); printf("\n"); } return 0; }
#include <stdio.h> #include <math.h> int main() { double c, f; while (scanf_s("%lf", &c) != EOF) { f = 5/9 * c + 32; printf("摄氏度c=%.2f,华氏度f=%.2f\n", c, f); printf("\n"); } return 0; }
3
#include<stdio.h> #include<math.h> int main() { int n; long double sum, a; scanf_s("%d", &n); a = pow(2, n); sum = (1 - a) / (1 - 2); printf("求和结果为:%lf", sum); return 0;
}
4
#include<stdio.h> int main() { double x, y; char c1, c2, c3; int a1, a2, a3; scanf_s("%d%d%d", &a1, &a2, &a3); printf("%d,%d,%d\n", a1, a2, a3); scanf_s("%c%c%c", &c1, &c2, &c3); printf("%c,%c,%c\n", c1, c2, c3); scanf_s("%lf,%lf", &x, &y); printf("%lf,%lf\n", x, y); return 0; }
5
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include<stdlib.h> int main() { int age1, age2; char gender1, gender2; scanf("%d%c%d%c", &age1, &gender1, &age2, &gender2); printf("age1 = %d,gender1 = %c\n", age1, gender1); printf("age2 = %d,gender2 = %c\n", age2, gender2); system("pause"); return 0; }
6
#include <stdio.h> #include <stdlib.h> int main() { char ans1, ans2; printf("每次课前认真预习、课后及时复习了没? (输入y或Y表示有,输入n或N表示没有) ;"); ans1 = getchar(); getchar(); printf("\n动手敲代码实践了没? (输入y或Y表示敲了,输入n或N表示木有敲) : "); ans2 = getchar(); if ((ans1 == 'y' || ans1 == 'Y') && (ans2 == 'y' || ans2 == 'Y')) printf("\n罗马不是一天建成的, 继续保持哦:)\n"); else printf("\n罗马不是一天毁灭的, 我们来建设吧\n"); system("pause"); return 0; }
标签:lf,main,Task,return,int,printf,include From: https://www.cnblogs.com/wzy4818/p/16801645.html