Advertisement
JewishCat

Ykaz_3v

Dec 25th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5. int str_zamena(char *str);
  6. int main() {
  7.    
  8.     char *str = new char;
  9.     cin.getline(str,1000);
  10.     int (*ptr)(char *str);
  11.     ptr=str_zamena;
  12.     cout << ptr(str) << " " << str;
  13.     return 0;
  14. }
  15. int str_zamena(char *str){
  16.     int nom=0;
  17.     int i=0;
  18.     while(str[i]!='\0'){
  19.         if(str[i]>96 && str[i]<123 ){
  20.             str[i]=str[i]-32;
  21.             nom++;
  22.         }    
  23.         i++;
  24.     }
  25.     return nom;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement