标签:
#include "stdio.h"
#include "conio.h"
#include "stdafx.h"
#include <iostream>
using namespace std;
void upper(char* s, char* us)
{
    while(*s != ‘\0‘)
    {
        if(*s >= ‘a‘ && *s <= ‘z‘)
        {
            *us = *s - 32;
        }
        else
        {
            *us = *s;
        }
        s++;
        us++;
    }
    *us = ‘\0‘;//注意不要漏了这一句
}
int main()
{
    char A[20],B[20];
    printf("Please input a string:\n");
    scanf_s("%s", A, 20);
    upper(A,B);
    printf("%s", B);
	system("pause");
}
标签:
原文地址:http://www.cnblogs.com/qingfengshuimu/p/5226602.html