diff --git a/Lesson/14.03/l2.c b/Lesson/14.03/l2.c new file mode 100644 index 0000000..d19ca2e --- /dev/null +++ b/Lesson/14.03/l2.c @@ -0,0 +1,41 @@ +#include +#include +#include +#include + +#define N 5 + +struct st1{ + int i; + char s[128]; +}; + +void st_rand(struct st1 temp[], int n){ + int k; + int j; + + srand(time(NULL)); + for(k=0; ki = rand()%100; + for(j=0;j<127;j++){ + (temp+k)->s[j]=((char)(65+rand()%25)); + } + (temp+k)->s[127]='\0'; + } +} + +void st_print(struct st1 temp[], int n){ + int k; + for(k=0;k[%2d][%s]\n", k, temp[k].i, (temp+k)->s); + } +} + +int main(int argc, char *argv[]){ + struct st1 q[N]; + + st_rand(q,N); + st_print(q,N); + + return 0; +} \ No newline at end of file diff --git a/Lesson/14.03/output/l2.exe b/Lesson/14.03/output/l2.exe new file mode 100644 index 0000000..6429fd8 Binary files /dev/null and b/Lesson/14.03/output/l2.exe differ