Advertisement
MeShootIn

2

Feb 28th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. /*
  2. ЛАБОРАТОРНАЯ РАБОТА № 2
  3. ВАРИАНТ 20
  4. ВЫПОЛНИЛ: ДМИТРИЙ МИШУТИН КЭ - 101
  5. */
  6.  
  7. #include <stdio.h>
  8. #include <iostream>
  9.  
  10. #define a 10
  11. #define b 20
  12. #define c 2
  13.  
  14. #ifndef a
  15.     #error a не определена
  16. #endif
  17.  
  18. #ifndef b
  19.     #error b не определена
  20. #endif
  21.  
  22. #ifndef c
  23.     #error c не определена
  24. #endif
  25.  
  26. #if(c == 1)
  27.     #define F(a, b, c) a * b
  28. #elif(c == 2)
  29.     #define F(a, b, c) a + b
  30. #elif(c == 3)
  31.     #define F(a, b, c) a - b
  32. #endif
  33.  
  34. using namespace std;
  35.  
  36. int main(){
  37.     printf("%d\n", F(a, b, c));
  38.     system("PAUSE");
  39.     return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement