Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main(int argc, char * argv[]) {
- if(argc < 3) { // brojot na argumenti e pomal od 3, sto znaci deka ne sme vnele dovolno za da imame ime na vlezna i izlezna datoteka
- printf("Vnesete gi iminjata na datotekite preku komadna linija\n");
- return 0;
- }
- FILE * in = fopen(argv[1], "r");
- FILE * out = fopen(argv[2], "w");
- if(in == NULL) {
- printf("Ne vnesovte validen fajl za citanje\n");
- return 0;
- }
- if(out == NULL) {
- printf("Ne vnesovte validen fajl za pecatenje\n");
- return 0;
- }
- char niza[2000];
- fgets(niza, 200, in);
- int brojac = 0;
- for(int i = 0; i < strlen(niza); i++) {
- char c = niza[i];
- if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
- brojac++;
- }
- }
- printf("%d\n", brojac);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement