Решения на задачите от час
#include <stdio.h>
int main () {
char c;
char str[15];
int a;
c = getchar ();
putchar (c);
putchar ('\n');
fgets (str, 15, stdin);
puts (str);
scanf ("%s", str);
printf ("%s\n", str);
printf ("%d\n", scanf ("%d", &a));
printf ("%d\n", a);
printf ("%d\n", (scanf ("%d", &a)) != EOF);
while (scanf ("%d", &a) != EOF) {
printf ("%d\n", a);
}
return 0;
}
#include <stdio.h>
int fib(int n) {
if(n == 1 || n == 0) {
return 1;
}
return fib(n-1) + fib(n - 2);
}
int main(int argc, char* argv[]) {
char** argv
char argv[][]
for(int i=0; i< argc; i++) {
printf("%s\n", argv[i]);
}
printf("%d\n", fib(5));
int n;
for(int i=0; i< 10; i++) {
scanf("%d", &n);
printf("%d\n", fib(n));
}
for(int i = 1; i < argc; i++) {
printf("%d\n", fib(atoi(argv[i])));
}
return 0;
}