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/p/9720315.html

时间: 2024-08-29 10:36:55

Problem S: 零起点学算法14——三位数反转的相关文章

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

1107: 零起点学算法14--三位数反转 Time Limit: 1 Sec  Memory Limit: 64 MB   64bit IO Format: %lldSubmitted: 4915  Accepted: 2378[Submit][Status][Web Board] Description 水题 Input 输入1个3位数(题目包含多组测试数据) Output 分离该3位数的百位.十位和个位,反转后输出(每组测试数据一行) Sample Input 250 Sample Out

武汉科技大学ACM :1003: 零起点学算法14——三位数反转

Problem Description 水题 Input 输入1个3位数(题目包含多组测试数据) Output 分离该3位数的百位.十位和个位,反转后输出(每组测试数据一行) Sample Input 250 Sample Output 052 HINT 分离出各位数字可以用取余和除数 注意在C语言里,2个整数相乘除结果还是整数 比如8/3在C语言里结果是2 取余采用符号% 比如8%3的结果应该是2即8除以3后的余数 1 #include <stdio.h> 2 3 int main() 4

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 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.