高级语言程序设计第二次作业 
这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj
这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16748
学号:0102600115
姓名:李煜钧

include<stdio.h>
int main(void)
{
int num;
double second=3.156e7;
printf("请输入你的年龄:");
scanf("%d",&num);
printf("秒数:%e\n",num*second);
return 0;
}

include<stdio.h>
int main(void)
{
float weight;
float value;
printf("Are you worth your weight in platinum?\n");
printf("Let's check it out.\n");
printf("Please enter your weight in pounds:");
scanf("%f",&weight);
value=1700.0weight14.5833;
printf("Your weight in platinum is worth $%.2f.\n",value);
printf("You are easily worth that!If platinum prices drop,\n");
printf("eat more to maintain your value.\n");
return 0;
}

include<stdio.h>
int main(void)
{
int i = 2147483647;
unsigned int j = 4294967295;
printf("%d %d %d\n", i, i+1, i+2);
printf("%u %u %u\n", j, j+1, j+2);
return 0;
}

include<stdio.h>
int main(void)
{
float num;
printf("Enter a floating-point value:",num);
scanf("%f",&num);
printf("fixed-point notation:%f\n",num);
printf("exponential notation:%e\n",num);
printf("p notation:%a\n",num);
return 0;
}

include <stdio.h>
int main(void)
{
/* ---------- (1) 实数的不同输出形式 ---------- */
double x = 123.456789;
double y = -3.14159;
printf("===== (1) 实数输出 =====\n");
/* %f:系统指定宽度,默认6位小数 */
printf("%%f : [%f]\n", x);
printf("%%f : [%f]\n", y);
/* %m.nf:指定宽度m,小数位数n,右靠齐 /
printf("%%10.2f : [%10.2f]\n", x); / 宽度10,2位小数,右靠齐 /
printf("%%10.3f : [%10.3f]\n", y); / 注意符号也占宽度 */
/* %-m.nf:指定宽度m,小数位数n,左靠齐 */
printf("%%-10.2f : [%-10.2f]\n", x);
printf("%%-10.3f : [%-10.3f]\n", y);
/* ---------- (2) 字符串的不同输出形式 ---------- */
char s[] = "1234567";
printf("\n===== (2) 字符串输出 =====\n");
/* %s:不指定宽度 */
printf("%%s : [%s]\n", s);
/* %-ms:指定宽度m,左靠齐 */
printf("%%-15s : [%-15s]\n", s);
/* %ms:指定宽度m,右靠齐 */
printf("%%15s : [%15s]\n", s);
/* %m.ns:指定宽度m,只取左端n个字符,右靠齐 */
printf("%%15.5s : [%15.5s]\n", s);
/* %-m.ns:指定宽度m,只取左端n个字符,左靠齐 */
printf("%%-15.5s : [%-15.5s]\n", s);
return 0;
}

include<stdio.h>
int main(void)
{
printf("\a");
printf("Startled by the sudden sound,Sally shouted,\n");
printf(""By the Great Pumpkin,what was that!"\n");
return 0;
}









include<stdio.h>
int main(void)
{
printf("输入夸脱数:");
double q;
scanf("%lf",&q);
double n=950.0;
double total=(q*n);
printf("水分子数:%e\n",total);
return 0;
}

include <stdio.h>
int main(void)
{
double inches;
double cm_per_inch = 2.54;
printf("Please enter your height in inches: ");
scanf("%lf", &inches);
printf("Your height in centimeters is: %.2f cm\n", inches * cm_per_inch);
return 0;
}

include <stdio.h>
int main(void)
{
double cups;
printf("Please enter the number of cups: ");
scanf("%lf", &cups);
double ounces = cups * 8.0;
double pints = cups / 2.0;
double tablespoons = ounces * 2.0;
double teaspoons = tablespoons * 3.0;
printf("%.2f cups equals:\n", cups);
printf("%.2f pints\n", pints);
printf("%.2f ounces\n", ounces);
printf("%.2f tablespoons\n", tablespoons);
printf("%.2f teaspoons\n", teaspoons);
return 0;
}
还是有地方会弄不清楚要一直反复看书,不能把每个对应的记下来

浙公网安备 33010602011771号