-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello.cpp
87 lines (83 loc) · 1.2 KB
/
hello.cpp
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
82
83
84
85
86
87
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main()
{
// 1. 1
// 2. *
// 2. **
// 2. 3,4,6
// 3. 7
// 4. 4
// 5. 1
// 6. 4
// 7.
// int score = 0;
// cout << "Please enter the student's score:";
// cin >> score;
// int grade;
// if (score >= 90 && score <= 100)
// {
// grade = 4;
// }
// else if (score >= 80)
// {
// grade = 3;
// }
// else if (score >= 70)
// {
// grade = 2;
// }
// else if (score >= 60)
// {
// grade = 1;
// }
// else
// {
// grade = 0;
// }
// switch (grade)
// {
// case 4:
// cout << "A" << endl;
// break;
// case 3:
// cout << "B" << endl;
// break;
// case 2:
// cout << "C" << endl;
// break;
// case 1:
// cout << "D" << endl;
// break;
// case 0:
// cout << "F" << endl;
// break;
// }
// 8.
int i;
string str;
cout << "enter: " << endl;
cin >> str;
i = 0;
char lowercase = '*';
do
{
if(islower(str[i]))
{
break;
}
i++;
}
while(i < str.size());
if (i == str.size())
{
cout << "No lowercase character." << endl;
}
else
{
cout << str[i] << endl;
}
return 0;
}