Problem C: 零起点学算法18——3个数比较大小

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

原文地址:https://www.cnblogs.com/chenlong991223/p/9744469.html

时间: 2024-07-30 00:08:29

Problem C: 零起点学算法18——3个数比较大小的相关文章

Problem B: 零起点学算法17——2个数比较大小

#include<stdio.h> int main() { int n,m; while(scanf("%d %d",&n,&m)!=EOF) if(n<m) printf("%d %d",m,n); else printf("%d %d",n,m); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9744421.html

Problem O: 零起点学算法10——求圆柱体的表面积

#include<stdio.h> int main() { float r,h,pi; pi=3.1415926; scanf("%f %f",&r,&h); printf("Area=""%.3f",2*pi*r*r+2*pi*r*h); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9720035.html

Problem U: 零起点学算法19——输出特殊值

#include<stdio.h> int main() { printf("%%d"); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9720422.html

Problem V: 零起点学算法20——输出特殊值II

#include<stdio.h> int main() { printf("\\n"); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9720428.html

Problem S: 零起点学算法14——三位数反转

#include<stdio.h> #include<stdlib.h> int main() { int a,b,c,s; scanf("%d",&s); a=s/100; b=s%100/10; c=s%100%10; printf("%d%d%d",c,b,a); system("pause"); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/

Problem T: 零起点学算法15——交换变量

#include<stdio.h> int main() { int a,b,c; scanf("%d %d",&a,&b); c=a; a=b; b=c; printf("%d %d",a,b); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9720399.html

Problem Z: 零起点学算法22——求正弦和余弦

#include<stdio.h> #include <math.h> int main() { int n; const double pi=acos(-1); double a,b; while(scanf("%d",&n)!=EOF) a=sin(n*pi/180); b=cos(n*pi/180); printf("%.2f\n%.2f\n",a,b); return 0; } 原文地址:https://www.cnblogs

Problem Y: 零起点学算法21——摄氏温度转换

#include<stdio.h> int main() { float f,c; while(scanf("%f",&f)!=EOF) c=5.0/9*(f-32); printf("%.3f",c); return 0; } 原文地址:https://www.cnblogs.com/chenlong991223/p/9742929.html

Problem A: 零起点学算法16——鸡兔同笼

#include<stdio.h> int main() { int n,m,a,b; while(scanf("%d %d",&n,&m)!=EOF) a=(m-2*n)/2; b=(m-2*n)%2; if(a>0 && b==0) printf("%d %d\n",n-a,a); else printf("No"); return 0; } 原文地址:https://www.cnblogs.