-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (52 loc) · 1.3 KB
/
main.cpp
File metadata and controls
53 lines (52 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
int main() {
using namespace std;
int var;
printf("Vivesty nomer varianta 1-5: ");
scanf("%d",&var);
printf("\n");
switch (var){
case 1:
for (int i=1; i<=256; i++){
char c=i;
if (i%5==0){
printf("%c",c);
cout<<"\n";
}
else printf("%c",c);
}
break;
case 2:
for (int i=1;i<=256; i++){
char c=i;
if (i%2==0)
printf("%c",c);
else cout <<"\n";
}
break;
case 3:
for (int i=5;i<=10;i++){
char c=i;
printf("%c",c);cout<<"";
}
break;
case 4:
for (int i=20; i<=30;i++){
char c=i;
for (int j=1;j<=(i%20);j++){
cout<<"";
}
printf ("%c",c);
cout<<"\n";
}
break;
case 5:
for (int i=50;i>=25;i--){
char c=i;
printf("%c",c);
cout<<"\n";
}
break;
default: printf("Vivesty nomer1-5");
}
}