void main char ch 500 int while true printf Input the number of elemen

 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
void main() {
char ch[500] ;int k;
while(true)
{
printf( "Input the number of elements of the array from 1 to 100:\n" );
//scanf( "%9d%1[^\n]",&number );
k= scanf("%9d%1[^\n]", &number, ch);
//fflush(stdin);
if(k == 1) {
break;
} else {
printf("Error! Input valid number!\n");
}
if( number > 100 || number < 0 )
printf("\nEnter retry!\n");
else{
//fflush(stdin);//хуй его знает, нужно или нет, ЗАЕБАЛО ВСЕ:)
break;
}
printf( "\n" );
}
/*while(true)
{
printf( "Input the number of elements of the array from 1 to 100:\n" );
scanf( "%d",&number );
while(true)
{
while ((ch=getchar()) != '\n')
putchar(ch);
break;
}
if( number > 100 || number < 0 )
printf("\nEnter retry!\n");
else{
//fflush(stdin);//хуй его знает, нужно или нет, ЗАЕБАЛО ВСЕ:)
break;
}
printf( "\n" );
}*/
printf( "\nElements in the array. Choose the item in Main Menu:\n");
printf( "\n" );
while( true ) {
//menu items
switch( mainMenu() ) {
case 1:
inputOfArray();
break;
case 2:
outputOfArray();
break;
case 3:
algorithmExec();
break;
case 4:
return;
break;
default:
printf( "Error of the input. Try again.\n" );
break;
}
printf( "\nPlease, press any key to continue." );
/*
returns the next character read from the console,
but does not display this symbol on the screen.
*/
getch();
//clean the screen
system( "cls" );
}
}