C programming: How to check whether the input string contains combination of uppercase and lowercase

后端 未结 7 871
旧时难觅i
旧时难觅i 2021-01-23 00:25

I\'m totally newbie here. As stated above, I would like to know how to check whether the input string contains combination of uppercase and lowercase. After that print a stateme

7条回答
  •  遥遥无期
    2021-01-23 01:17

    Iterate every char in the input string (i am assuming it's homework and it's ASCII) and check whether the char is lower case letter. In this case, set to true a variable which marks whether lower case letter was met. Do the same for upper case (or you could do it in the same loop). Then form your output based on the two boolean variables.

提交回复
热议问题