Do C language to strangers

xiaoxiao2021-03-06  65

Looking at the face of high school students, give a unknown, unknown gender, and the stranger in the place answers 11 C language questions on QQ, which found that I am a good person is all content, maybe for some people useful 1 . Edit, enter Fahrenheit Temperature (F), calculate and output the corresponding Celsius temperature (C): c = 5 (F-32) / 9 by following the following formula

Main () {float f, c; scanf ("please input f% f", & f); c = (5 * (f-32)) / 9; Printf ("The Result C IS% F / N", C }

2. Component, enter an integer, output its symbol (if> = 0, output 1; if <0, output -1)

Main () {Int n, m; printf ("please input an integer"); if (n> = 0) {m = 1;} else {m = 0;} printf ("the result is% I / N" , M);

3. Calculate the E value main () {INT I, N; FLOAT E = 1.0; Printf ("please input n"); scanf ("% i", & n); for (i = 1; i

4. Calculate ymain () {Int n, i; float y; "" please input an integer n "); scanf ("% i ", & n); y = 0.0; for (i = 1; i

5. Judging whether N is the number

Main () {INT N, I, FLAG = 1; FLAAT M; Printf ("please input an integer n"); scanf ("% i", & n); m = sqrt (n); for (i = 2; I

}

6. Search for the minimum main () {Float A, B, C, Temp; Printf ("% f% f% f", & A, & B, & C ("% f% f% f", & a, & c ); if (a> b) {temp = b;} else {temp = a;} if (temp> c) {TEMP = C;} Printf ("The minimum number IS% f", TEMP);}

7. Ask for a three-digit number, the digital cubes and the main (Int A, B, C; For (a = 1; a <= 9; a ) for (b = 0; B <= 9 ; b ) for (c = 0; c <= 9; C ) IF (A * a * a b * b * b c * c * c == 1099) Printf ("% d / n", (10 * a b) * 10 c);}

8. The number of positive numbers, negative numbers, 0 in the statistical input, MAIN () {INT I, D, N, Z, P; N = Z = P = 0; for (i = 1; i <= 10 i ) {Printf ("Input the% d th integer", I); scanf ("% d", & d); if (d <0) n ; ELSE IF (D> 0) P ; Else Z ;} printf ("NEGATIVE IS% D Positive IS% D Zero IS% D / N", N, P, Z);} 9. Calculate 1-100 square and main () {INT i, J, K; Long L, M, N; L = m = n = 0; for (i = 1; i <= 100; i ) {L = i * i;} j = 1; while (j <= 100) { M = j * j; j ;} k = 1; do {n = k * k; k ;} while (k <= 100); Printf ("% ld,% ld,% ld / n", L, M , N);

10. Survey the number of cycles Main () {INT I, J, S = 0; for (i = 5; i; i -) for (j = 0; j <4; j ) {s ;} printf ("% D ", s);

11. Ask the output result main () {int y = 9; for (; y> 0; y -) IF (Y% 3 == 0) {Printf ("% d", - y); Continue;} }

转载请注明原文地址:https://www.9cbs.com/read-110309.html

New Post(0)