Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <cstring>
- #include <ctype.h>
- #include <stdio.h>
- using namespace std;
- #define NMAX 100
- #define LENMAX 256
- #define INFILE "SIRURI.TXT"
- int numarare(char s[], int& nrl)
- {
- nrl = 0;
- for (int i = 0; s[i]; i++)
- if (isupper(s[i]))
- nrl++;
- }
- void read(int& n, char c[][LENMAX])
- {
- ifstream fin(INFILE);;
- fin >> n;
- fin.get();
- for (int i = 0; i < n; i++)
- fin.getline(c[i], LENMAX);
- }
- char c[NMAX][LENMAX], r[LENMAX];
- int n;
- int maxi = -1, cnr;
- int main()
- {
- read(n, c);
- for (int i = 0; i < n; i++)
- {
- numarare(c[i], cnr);
- if (maxi <= cnr)
- {
- maxi = cnr;
- strcpy(r, c[i]);
- }
- }
- puts(r);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement