We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4ea320 commit c46e46dCopy full SHA for c46e46d
Windows_System_examples/Love-Calculator/main.c
@@ -2,7 +2,8 @@
2
#include <stdlib.h>
3
4
5
-void enter_string(char* message, char* s, size_t s_size) {
+void enter_string(char* message, char* s, size_t s_size)
6
+{
7
printf("%s", message);
8
fgets(s, s_size, stdin);
9
}
@@ -23,13 +24,12 @@ int get_score(char* s)
23
24
char c;
25
for(char* p = s; p != end; ++p)
26
{
- c = *p ^ 0x20;
27
+ c = *p;
28
+ if(c == ' ') continue;
29
- if(c == ' ')
- {
30
- continue;
31
- }
32
- else if(c >= 'A' && c <= 'Z')
+ c &= ~0x20;
+
+ if(c >= 'A' && c <= 'Z')
33
34
score += c - '@';
35
0 commit comments