第1个回答 2010-11-05
#include <stdio.h>
#include<stdlib.h>
//#include<iostream>
// using namespace std;
int main ()
{
int i,n,m;
char st[100];
char str[10];
scanf("%d",&n);
gets(str);
for(i=0;i<n;i++)
scanf("%c",&st[i]);
//m=sizeof(st);
//printf("%d",m);
for(i=0;i<n;i++)
printf("%c ",st[i]);
printf("\n********************\n");
for(i=0;i<n;i++)
{if(97<=st[i]&&st[i]<=122)
st[i]=st[i]-32;}
for(i=0;i<n;i++)
printf("%c",st[i]);
system("pause");
}
第3个回答 2010-11-06
#include"stdio.h"
#include"ctype.h"
main()
{
char s[101];
int i=0;
fgets(s,101,stdin);
for(;s[i];i++)
if(islower(s[i]))
s[i]=toupper(s[i]);
printf("%s",s);
}