Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- int main(int argc, char * argv[]) {
- if(argc < 2) {
- printf("Imeto na vleznata datoteka treba da se vnese preku komanda linija\n");
- return 0;
- }
- FILE *in = fopen(argv[1], "r");
- if(in == NULL) {
- printf("Vnesovte nepostoecka vlezna datoteka\n");
- return 0;
- }
- char niza[2000];
- char res_niza[2000];
- int najmal_broj_na_mali_bukvi = 2000;
- int red = 1, res_red = 1;
- while(fgets(niza, 80, in) != NULL) {
- int brojac = 0;
- for(int i = 0; i < strlen(niza); i++) {
- if(isalpha(niza[i])) {
- if(islower(niza[i])) {
- brojac++;
- }
- }
- }
- if(brojac < najmal_broj_na_mali_bukvi) {
- najmal_broj_na_mali_bukvi = brojac;
- res_red = red;
- strcpy(res_niza, niza);
- }
- red++;
- }
- printf("%s", res_niza);
- printf("%d\n", res_red);
- }
- /*
- 4
- 1 2 10 0
- 7 2 3 1
- 6 0 5 4
- 4 1 0 1
- 4
- 4 1 0 1
- 6 0 5 4
- 7 2 2 1
- 1 1 10 0
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement