File tree 5 files changed +83
-0
lines changed
5 files changed +83
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ int n;
6
+ cin >> n;
7
+ int nMin, nMax;
8
+ double nMean = 0 ;
9
+ for (int i = 0 ; i < n; i++)
10
+ {
11
+ int tmp;
12
+ cin >> tmp;
13
+ if (i == 0 )
14
+ {
15
+ nMin = tmp;
16
+ nMax = tmp;
17
+ }
18
+ else
19
+ {
20
+ if (tmp < nMin) nMin = tmp;
21
+ if (tmp > nMax) nMax = tmp;
22
+ }
23
+ nMean += tmp;
24
+ }
25
+ nMean /= n;
26
+ cout << " Mean:" << nMean << endl;
27
+ cout << " Max:" << nMax << endl;
28
+ cout << " Min:" << nMin << endl;
29
+ return 0 ;
30
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ int n;
6
+ do
7
+ {
8
+ cin >> n;
9
+ if (n >= 0 && n % 5 == 0 ) cout << n / 5 << endl;
10
+ else if (n == -1 ) cout << " Bye" ;
11
+ else cout << -1 << endl;
12
+ } while (n != -1 );
13
+ return 0 ;
14
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ for (int i = 0 ; i < 24 ; i++)
6
+ {
7
+ if (i == 0 ) cout << " 12 midnight" << endl;
8
+ else if (i >= 1 && i <= 11 ) cout << i << " am" << endl;
9
+ else if (i == 12 ) cout << " 12 noon" << endl;
10
+ else cout << i - 12 << " pm" << endl;
11
+ }
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ int n;
6
+ cin >> n;
7
+ for (int i = 1 ; i <= n; i++)
8
+ {
9
+ for (int j = 1 ; j <= i; j++) cout << ' *' ;
10
+ cout << endl;
11
+ }
12
+ return 0 ;
13
+ }
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ using namespace std ;
3
+ int main ()
4
+ {
5
+ int n;
6
+ cin >> n;
7
+ for (int i = n; i >= 1 ; i--)
8
+ {
9
+ for (int j = 1 ; j <= i; j++) cout << ' *' ;
10
+ cout << endl;
11
+ }
12
+ return 0 ;
13
+ }
You can’t perform that action at this time.
0 commit comments