任务一
#include <stdio.h> #include <stdlib.h> #include <time.h> #define N 5 #define R1 586 #define R2 701 int main() { int number; int i; srand( time(0) ); for(i = 0; i < N; ++i) { number = rand() % (R2 - R1 + 1) + R1; printf("20228330%04d\n", number); } return 0; }
18行在计算输出number的值
任务二
#include<stdio.h> int main() { double x, y; char c1, c2, c3; int a1, a2, a3; scanf("%d %d %d", &a1, &a2, &a3); printf("a1 = %d, a2 = %d, a3 = %d\n", a1,a2,a3); scanf("%c %c %c", &c1, &c2, &c3); printf("c1 = %c, c2 = %c, c3 = %c\n", c1, c2, c3); scanf("%lf %lf", &x, &y); printf("x = %lf, y = %lf\n",x, y); return 0; }
任务三
#include <stdio.h> #include <math.h> int main() { double x, ans; while(scanf("%lf", &x) != EOF) { ans = pow(x, 365); printf("%.2f的365次方: %.2f\n", x, ans); printf("\n"); } return 0; }
标签:lf,int,scanf,number,实验,printf,include From: https://www.cnblogs.com/gixing/p/17223520.html