Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- # define MAX 81
- void writeToFile() {
- FILE *f = fopen("text.txt", "w");
- char c;
- while((c = getchar()) != '#') {
- fputc(c, f);
- }
- fclose(f);
- }
- int main() {
- writeToFile();
- // vasiot kod ovde
- char line[ MAX ] ;
- FILE *f = fopen("text.txt", "r");
- int redenBroj = 1;
- int najgolemBrojBukvi = 0;
- int redSoNajgolemBrojBukvi = 1;
- while (( fgets ( line , MAX , f ) ) != NULL ) {
- int brojBukviVoMomentalnaRedica = 0;
- int k;
- int length = strlen(line);
- for(k=0; k<length; k++){
- if(isupper(line[k])){
- brojBukviVoMomentalnaRedica++;
- }
- }
- if(brojBukviVoMomentalnaRedica > najgolemBrojBukvi){
- redSoNajgolemBrojBukvi = redenBroj;
- najgolemBrojBukvi = brojBukviVoMomentalnaRedica;
- }
- redenBroj++;
- }
- fclose(f);
- printf("%d", redSoNajgolemBrojBukvi);
- }
Add Comment
Please, Sign In to add comment