1.#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main(){
char a,b,c;
int t;
scanf("%c%c%c", &a, &b, &c);
if (a >= b){ t = a; a = b; b = t; }
if (a >= c){ t = a; a = c; c = t; }
if (b >= c){ t = c; c = b; b = t; }
printf("%c %c %c", a, b, c);
getchar();
getchar();
return 0;
}
/*题目
输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。
Input
输入数据有多组,每组占一行,有三个字符组成,之间无空格。
Output
对于每组输入数据,输出一行,字符中间用一个空格分开。
Sample Input
qwe
asd
zxc
Sample Output
e q w
a d s
c x z
*/
/*
数字与其对应的ASCII码是完全相同的,只是变量类型不同,
ASCII码的类型为字符,输入输出使用%c
数字为整形,输入输出时用%d。
*/
2.#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
float x1, y1, x2, y2;
float l;
scanf("%f %f %f %f", &x1, &y1, &x2, &y2);
l = sqrt((x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2));
printf("%3.2f", l);
getchar();
getchar();
return 0;
}
/*无难点
浮点数可以通过f、lf前面加上小数点、在小数点写上具体数值
可以控制浮点数精确到小数点后几位
例如printf("%.2f", l)就将l的计算结果精确到小数点后两位。
同时原有的空格功能未消失
可在在小数点前面加上数字
例如printf("%3.2f", l)*/