高级语言程序设计第二次作业 

这个作业属于哪个课程:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj

这个作业要求在哪里:https://edu.cnblogs.com/campus/fzu/2026gjyycxsj/homework/16748
学号:0102600115
姓名:李煜钧
E5CA0E1793AD421621DC150A3C8C4A61

include<stdio.h>

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

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;
}
DBCC8DF237E0EA105A8B9ABEF9ECDCB1

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;
}
D29E317935635BBF55AB83F0EF9190DD

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;
}
B38897146EB1576265B16BB704C79EDE

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;
}
A50F921B0A13228AA3590670878C8DB1

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;
}
A21A8D47EBB361D1E4B216E2049BC2C8

3854A0741A0F2CE05D7181B41099E3F9

243A644647A227DA8C1B2A85F9855844

64D24A09303F137A29367DAE08EC42DE

16A08FC8C6A519B0813768A5DF6AC4D6

15B478C6C8C826BC0A4314EB120FA863

7CC91D7D9563CAF33A14573C58F4AAFD

4E5874DF16E87AE45D8208B88AF55EA3

B4332FE89D180BBB3623F4B58F0EEB9C

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;

}
AD3A733158701A2C694942FF2DEBA154

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;
}
3F4602CF48AAE060E33427325D612B19

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;
}
还是有地方会弄不清楚要一直反复看书,不能把每个对应的记下来

posted @ 2026-10-21 22:27  李煜钧  阅读(5)  评论(0)    收藏  举报