Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include<stdio.h>
- //#include<stdlib.h>
- //#include<time.h>
- //#include<string.h>
- //int main(void)
- //{
- // float polje[200], kopija[101];
- // int i;
- // srand((unsigned)time(NULL));
- // for (i = 0; i < 200; i++)
- // {
- // polje[i] = -5 + (float)rand() / RAND_MAX * 15;
- // printf("%d. %f\n", i + 1, polje[i]);
- // }
- // puts("\nKopija:");
- // memcpy(kopija, polje + 49, 101 * sizeof(float));
- // for (i = 0; i <= 100; i++)
- // printf("%d. (%d.) %f\n", i+1, i+50, kopija[i]);
- // return 0;
- //}
- //#include<stdio.h>
- //#include<stdlib.h>
- //#include<string.h>
- //int main(void)
- //{
- // char string[16];
- // int i, brojac = 0;
- // puts("Unesite recenicu do 15 znakova");
- // fgets(string, 16, stdin);
- // do
- // {
- // puts("Unesite recenicu 8-15 znakova");
- // fgets(string, 16, stdin);
- // } while (strlen(string) < 8);
- // for (i = 0; string[i] != '\0'; i++)
- // {
- // switch (tolower(string[i]))
- // {
- // case 'a':
- // case 'e':
- // case 'i':
- // case 'o':
- // case 'u':
- // brojac++;
- // }
- // }
- // printf("Recenica ima %d samoglasnika", brojac);
- // return 0;
- //}
- //#include<stdio.h>
- //#include<math.h>
- //double rjesenje(double x1, double x2)
- //{
- // double y;
- // y = exp(x1 * x2) - pow(x1, 3) + pow(x2, 4) + sqrt(pow(x1, 2) + pow(x2, 2));
- // return y;
- //}
- //int main(void)
- //{
- // double x1, x2, y;
- // puts("Unesite vrijednosti varijabli x1 i x2");
- // scanf("%lf %lf", &x1, &x2);
- // y = rjesenje(x1, x2);
- // printf("Rjesenje jednadzbe je: %lf", y);
- // return 0;
- //}
- #include<stdio.h>
- #include<string.h>
- #include<stdlib.h>
- int string(char *p)
- {
- int broj = 0, i;
- for (i = 0; p[i] != '\0'; i++)
- {
- switch (p[i])
- {
- case '0' :
- case '1' :
- case '2' :
- case '3' :
- case '4' :
- case '5' :
- case '6' :
- case '7' :
- case '8' :
- case '9' :
- broj++;
- }
- }
- return broj;
- }
- int main(void)
- {
- char p[200];
- int broj;
- puts("Unesite recenicu");
- fgets(p, 200, stdin);
- broj = string(p);
- printf("Vasa recenica sadrzi %d znamenki", broj);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement