Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define SUPERMACRO
- int main()
- {
- int eresantno;
- int read, k, m1 = 0, m2 = 0, m3 = 0, m4 = 0, m5 = 0;
- int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = 0;
- scanf("%d", &k);
- for ( ; k > 0; k--){
- scanf("%d", &read);
- switch (read){
- case 1:
- m5 = 0;
- m1 = 1;
- m2 = 0;
- break;
- case 2:
- m1 = 0;
- m2 = 1;
- m3 = 0;
- break;
- case 3:
- m2 = 0;
- m3 = 1;
- m4 = 0;
- break;
- case 4:
- m3 = 0;
- m4 = 1;
- m5 = 0;
- break;
- case 5:
- m4 = 0;
- m5 = 1;
- m1 = 0;
- }
- if (m1 == 1){
- c1++;
- }
- if (m2 == 1){
- c2++;
- }
- if (m3 == 1){
- c3++;
- }
- if (m4 == 1){
- c4++;
- }
- if (m5 == 1){
- c5++;
- }
- }
- printf("%d %d %d %d %d", c1, c2, c3, c4, c5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement