Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. char str[110];
  5.  
  6.  
  7.  
  8. int main(){
  9.     /*
  10.     gets(str);
  11.  
  12.     char res[110];
  13.  
  14.     int j = 0;
  15.     for(int i = 0; str[i] != '\0'; i++){
  16.         if (str[i] != '3' && str[i] != '9'){
  17.             res[j] = str[i];
  18.             j++;
  19.         }
  20.     }  
  21.     res[j] = '\0';
  22.     printf("%s", res);
  23.     */
  24.     char c = '8';
  25.     int x = c - '0'; // ASCII - êîä 56
  26.    
  27.     printf("%d",  x + 2) ;
  28.    
  29.    
  30. /*
  31.     for(int i = 0; str[i] != '\0'; i++){
  32.         if (str[i] != '3' && str[i] != '9'){
  33.             printf("%c", str[i]);
  34.         }
  35.     }  
  36. */
  37. /* 
  38.     int i = 0;
  39.     while (str[i] != '\0'){
  40.         i++;
  41.     }
  42.    
  43.     // 'a' 'b' 'c' ... 'z'
  44.     int oper = 0;
  45.     for(int i = 0; str[i] != '\0'; i++){
  46.         if (str[i] == '+' || str[i] == '-' || str[i] == '*'){
  47.             oper++;
  48.         }
  49.        
  50.     }
  51.     if (str[0] == '-'){
  52.         oper--;
  53.     }
  54.    
  55.     printf("%s\n", str);
  56.     printf("%d\n", i);
  57.     printf("bukv u menya = %d", bukva);
  58.    
  59. */
  60.    
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement