Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- void main()
- {
- int z[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 };
- int s = 0, a;
- for (int i = 0; i < 16; i++) {
- switch (i) {
- case 1:
- case 2:
- case 3:
- case 4:
- a = -5;
- break;
- case 5:
- a = 2;
- break;
- case 7:
- a = 4;
- break;
- default:
- a = z[i];
- break;
- }
- s += z[i] - a;
- }
- cout << s;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement