Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cs50.h>
- #include <string.h>
- int main(void)
- {
- string s = get_string();
- if (s != NULL)
- {
- for (int i = 0, n = strlen(s); i < n; i++)
- {
- if (s[i] >= 'a' && s[i] <= 'z')
- {
- printf("%c", s[i] - 32);
- }
- else
- {
- printf("%c", s[i] - 32);
- }
- }
- }
- else
- {
- printf("%c", s[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement