The original question is like this: There are Natural Number of Natural Nature (1 - N) with n size (1 - n), and they are sorted by small to large. Requires the program algorithm: Time complexity is O (N), and the spatial complexity is O (1). (Please do it, time 20 minutes)
#include #include
Print_ok (int A [], int Num) {INT i; for (i = 0; I
INT main () {INT I, T; int Num = 5; int A [] = {3, 4, 1, 2, 0};
Print_ok (A, NUM);
For (i = 0; i
#include #include #include
Void Aad (INT A) {INT I;
IF (A! = 0) {AAD (- a); for (i = 1; i
INT main () {Int a = 4; AAD (a); return 0;
}
#include #include
Struct student {char name [Int Age;}; int main () {Int i; struct student he [3] = {{"abcd", 19}, {"efgh", 20}, {"ijkl" 21}}; for (i = 0; i <3; i) {printf ("% c", he [i] .Name [3]); Printf ("% d / n", - -he [i] .age);
}
#include #include
INT main () {Int a [3] [4] = {1, 2, 3, 4, 5, 6}; Printf ("% D / N,% D / N,% D / N,% D / N ", * a, a, * ((A 0) 0), & a [0] [0]);
}
#include #include #include