scanf(格式控制, 输出表列)
scanf(格式控制, 输出表列)
#include <iostream>
using namespace std;
int main( )
{
int a; float b; char c;
scanf("%d %c %f",&a,&c,&b); //注意在变量名前要加地址运算符&
printf("a=%d,b=%f,c=%c\n",a,b,c);
return 0;
}
12 A 67.98↙(本行为输入,输入的3个数据间以空格相间) a=12,b=67.980003,c=A(本行为输出)
putchar(c);
#include <iostream> //或者包含头文件stdio.h:#include <stdio.h>
using namespace std;
int main( )
{
char a,b,c;
a='B';b='O';c='Y';
putchar(a);putchar(b);putchar(c);putchar('\n');
putchar(66);putchar(79);putchar(89);putchar(10);
return 0;
}
BOY BOY
#include <iostream>
using namespace std;
int main( )
{
char c;
c=getchar( ); putchar(c+32); putchar('\n');
return 0;
}
putchar(getchar()+32);putchar('\n');
cout<<getchar( );
cout<<(c=getchar( )); //设c已定义为字符变量
cout<<(c=getchar( )+32);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有