Advertisement
Josif_tepe

Untitled

Aug 25th, 2023
766
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6.  
  7. int main(int argc, const char * argv[]) {
  8.     FILE *in = fopen("input.txt", "r");
  9.    
  10.     char c;
  11.     char zbor[1000];
  12.     int i = 0;
  13.     while(fscanf(in, "%c", &c) != EOF) {
  14.      
  15.         if(isalpha(c)) {
  16.             zbor[i] = c;
  17.             i++;
  18.         }
  19.         else {
  20.  
  21.             if(isupper(zbor[0])) {
  22.                 int dali_se_mali = 1;
  23.                 for(int j = 1; j < i; j++) {
  24.                     if(isupper(zbor[j])) {
  25.                         dali_se_mali = 0;
  26.                     }
  27.                 }
  28.                 if(dali_se_mali == 1) {
  29.                     for(int j = 0; j < i; j++){
  30.                         printf("%c", zbor[j]);
  31.                     }
  32.                     printf("\n");
  33.                 }
  34.             }
  35.             i = 0;
  36.         }
  37.     }
  38.     return 0;
  39.    
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement