SHARE
TWEET

Untitled

a guest Jan 21st, 2020 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #include <iostream>
  3.  
  4.  
  5. void main()
  6. {
  7.     setlocale(0, ".1251");
  8.     int t = 0, q = 0, w = 0, e = 0 , sum = 0;
  9.     //char s[2000] = "";
  10.     //printf("Ведите текст:");
  11.     //scanf_s("1999[^/n]s" , s , 2000);
  12.     char s[] = "уикуеворавуыцунqwdыкке!лндгж2шщозошгрнпеаквуыцк веоалпргшsрнешакучвасмпиргрнпеаквугеанп дгржшгsнпеаквувеаснмпsгнржщешкугкнквеанпгнргнщешкгукнкуекоалннагшпрщ ";
  13.  
  14.  
  15.  
  16.     for (int i = 0;; i++) {
  17.         if (s[i] == ' ') {
  18.             if (t != 0 && q != 0 && w != 0 && e != 0)
  19.                 sum += 1;
  20.  
  21.         t = 0, q = 0, w = 0, e = 0;
  22.         }
  23.         if (s[i] >= 'a' && s[i] <= 'z' || s[i] >= 'A' && s[i] <= 'Z')
  24.             t += 1;
  25.         if (s[i] >= 'а' && s[i] <= 'я' || s[i] >= 'А' && s[i] <= 'Я')
  26.             q += 1;
  27.         if (s[i] >= '!' && s[i] <= '/')
  28.             w += 1;
  29.         if (s[i] >= '0' && s[i] <= '9')
  30.             e += 1;
  31.        
  32.  
  33.         if (s[i] == 0)
  34.             break;
  35.     }
  36.  
  37.     printf("\n\n");
  38.  
  39.  
  40.     printf("%d ", sum);
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top