Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char castToBig(char ch){
- return ch+32;
- }
- char castToSmall(char ch){
- return ch-32;
- }
- int isBig(char ch){
- return ch >= 'A' && ch <= 'Z';
- }
- int isSmall(char ch){
- return ch >= 'a' && ch <= 'z';
- }
- int main()
- {
- char cur;
- int make_big = 0;
- printf("yahani");
- while(cur != '\n'){
- printf("yahani");
- scanf("%c", &cur);
- if(cur == '_'){
- make_big = 1;
- continue;
- }
- if(make_big){
- make_big = 0;
- if(isSmall(cur))
- cur = castToBig(cur);
- } else {
- if(isBig(cur))
- cur = castToSmall(cur);
- }
- printf("%c", cur);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement