Advertisement
icatalin

11.2 laborator 5

Nov 2nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5.  
  6. #undef _toupper
  7. #include "cod.h"
  8.  
  9. void tema1()
  10. {
  11.     char c;
  12.  
  13.         c = getchar();
  14.  
  15.          if ( _verif(c) == 1)
  16.                 _toupper(c);
  17.  
  18.     putchar(c);
  19. }
  20.  
  21. void prob2() {
  22.     char a, op, b;
  23.     int x, y;
  24.  
  25.     a = getchar();
  26.     op = getchar();
  27.     b = getchar();
  28.  
  29.     x = a - '0';
  30.     y = b - '0';
  31.  
  32.  
  33.  
  34.    switch (op)
  35.    {
  36.        int rez;
  37.  
  38.     case '*':
  39.             printf("%d",x * y);
  40.  
  41.     case '/':
  42.             printf("%d",x / y);
  43.  
  44.     case '+':
  45.             printf("%d",x + y);
  46.  
  47.     case '-':
  48.             printf("%d",x - y);
  49.  
  50.     case '%':
  51.             printf("%d",x % y);
  52.  
  53.     default:
  54.         break;
  55.    }
  56.  
  57. }
  58.  
  59. void prob3()
  60. {
  61.  
  62. }
  63.  
  64.  
  65. int main()
  66. {
  67.     prob3();
  68.  
  69.  
  70.     return 0;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement