P5733【深基6.例1】自动修正
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define N 100
int main()
{
char str[N];
char str1[N];
char c;
gets(str);
int len=strlen(str);
for(int i=0;i<len;i++)
{
c=str[i];
putchar(toupper(c));
}
return 0;
}
算法思路:
很简单。采用C语言函数,将小写转化为大写字母,对于每一个char 直接遍历即可
相关函数:
字符串头文件#include <string.h>
https://blog.csdn.net/tanrui519521/article/details/81162267 见博客 【转载】
犯错原因:
1.半天想不起字符串函数的使用方式,基础不牢
2.看错题目,将小写转化为大写