欢迎来到贱贱的博客

扩大
缩小

2基本输入输出

#include <stdio.h>

/*
    功能:简单加法
    时间:2016.11.14
*/
void main()
{
    int a;
    int b;
    scanf("%d+%d",&a,&b);//记住严格按照格式输入
    printf("a+b=%d",a+b);


    system("pause");
}
 1 #include <stdio.h>
 2 /*
 3     功能:求圆的面积
 4     时间:2016.11.14
 5 */
 6 void main4()
 7 {
 8     float area,r;
 9     scanf("%f",&r);//是%f 不是%d哦
10     area = 3.14159*r*r;
11     printf("%2f",area);//12.566360
12     printf("\n%0.2f",area);//12.57
13     printf("\n%0.3f",area);//12.566
14     printf("\n%.3f",area);//12.566 点可以省略
15     printf("%%f",area);//输出%的方法
16 
17     system("pause");
18 }
 1 #include <stdio.h>
 2 
 3 /*
 4     功能:字符输入输出
 5     时间:2016.11.14
 6 */
 7 void main()
 8 {
 9     
10     char ch = getchar();
11     putchar(ch);
12 
13     system("pause");
14 }

 

posted on 2016-11-15 19:29  L的存在  阅读(192)  评论(0编辑  收藏  举报

导航