实验一 C语言入门

【目的】
熟悉C语言开发环境和在线判题系统OJ的应用。
【内容】
1、浏览以下网站并注册:
http://oj.jzxx.net/
http://acm.tzc.edu.cn/
http://poj.org/
2、完成以下题目并提交
http://oj.jzxx.net/problem.php?id=1000
http://oj.jzxx.net/problem.php?id=1009
http://oj.jzxx.net/problem.php?id=1014
http://oj.jzxx.net/problem.php?id=1069

 

1009代码

#include <stdio.h>
int main(){
    int c;
    scanf("%d",&c);
    printf("%.2f\n",1.8*c+32);
    return 0;
}

 

1014代码

#include <stdio.h>
int main(){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if(b>a)a=b;
    if(c>a)a=c;
    printf("%d\n",a);
    return 0;
}

 1014代码(函数版)

#include <stdio.h> 
int max(int x,int y){ 
    int z; 
    if(x>y)z=x; 
    else z=y; 
    return z; 
} 
  
int main(){ 
    int a,b,c; 
    scanf("%d%d%d",&a,&b,&c); 
    printf("%d\n",max(max(a,b),c)); 
    return 0; 
} 

 

posted @ 2013-09-30 11:01  yan72013  阅读(425)  评论(0)    收藏  举报