Advertisement
Kentoo

N#1

Jan 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. void main()
  7. {
  8.     int z[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
  9.     int s = 0, a;
  10.     for (int i = 0; i < 16; i++) {
  11.         switch (i) {
  12.         case 1:
  13.         case 2:
  14.         case 3:
  15.         case 4:
  16.             a = -5;
  17.             break;
  18.         case 5:
  19.             a = 2;
  20.             break;
  21.         case 7:
  22.             a = 4;
  23.             break;
  24.         default:
  25.             a = z[i];
  26.             break;
  27.         }
  28.         s += z[i] - a;
  29.     }
  30.     cout << s;
  31.     system("pause");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement