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 < 2) {
- printf("Vlezna datoteka se vnesuva preku komandna linija\n");
- return 0;
- }
- FILE * in = fopen(argv[1], "r");
- if(in == NULL) {
- printf("Vnesovte ne validna vlezna datoteka\n");
- return 0;
- }
- char niza[2000];
- char c;
- int j = 0;
- while((c = fgetc(in)) != EOF) {
- if(isalpha(c)) {
- niza[j] = c;
- j++;
- }
- else {
- int golemi_bukvi = 0, mali_bukvi = 0;
- for(int i = 0; i < j; i++) {
- if(isalpha(niza[i])) {
- if(isupper(niza[i])) {
- golemi_bukvi++;
- }
- else {
- mali_bukvi++;
- }
- }
- }
- if(golemi_bukvi >= 2 && mali_bukvi >= 1) {
- for(int i = 0; i < j; i++) {
- printf("%c", niza[i]);
- }
- printf("\n");
- }
- j = 0;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement