- 2
- 0
- 约3.76千字
- 约 6页
- 2017-10-30 发布于浙江
- 举报
自己动手写的简单程序
【1】#include iostream
using namespace std;
//输出26个英文字母的大小写
int main()
{
char c,ch;
for(c=65;c=90;c++)
coutc ;
for(ch=97;ch=122;ch++)
coutch ;
return 0;
}
【2】#include iostream
using namespace std;
//大小写字母的转换
int main()
{
char c1,c2;
c1=a;
c2=b;
c1=c1-32;
c2=c2-32;
coutc1,c2endl;
return 0;
}
【或者是】:
#include iostream
using namespace std;
int main()
{
char ch;
cout请输入26个大写字母中的任意一个!endl;
cinch;
ch=(ch=Ach=Z)?(ch+32):ch;
coutchendl;
return 0;
}
【3】
#includeiostream
using namespace std;
float max(float x,float y){return(x=y?x:y);}
int main(){
float x,y;
cout输入两个实数:endl;
cinx
原创力文档

文档评论(0)