运行结果:
C语言代码:
/* c how to program 习题3.21 */
#include <stdio.h>
#include <stdlib.h>
int main()
{
//分别定义变量
int number;
//获取number的值
printf("Enter a number: ");
scanf("%d", ...
运行结果:
C语言代码:
/* c how to program 习题3.20 */
#include <stdio.h>
#include <stdlib.h>
int main()
{
//分别定义变量
double houers, rate, salary;
//获取第一个员工的工作时间
printf("Enter num ...
运行结果:
C程序代码:
/* c how to program 习题3.19 */
#include <stdio.h>
#include <stdlib.h>
int main()
{
//分别定义变量
double interest, principal, rate;
int days;
//获取第一次的贷款金额
...
运行结果:
C语言代码:
/* c how to program 习题 3.17 */
#include <stdio.h>
#include <stdlib.h>
int main()
{
//定义变量
int accountNumber;
double beginningBalance, totalCharges, totalCredits, credi ...
运行结果:
C语言代码:
/* c how to program 习题3.16 */
#include <stdio.h>
#include <stdlib.h>
int main()
{
//分别定义变量:燃油量,里程数,总的燃油量,总的里程数,油耗比,平均油耗比
float gallon, mile ...
//c how to program 习题2.31
#include <stdio.h>
int main( void )
{
int number = 0;
printf("number\tsqure\tcube\n");
printf("%d\t%d\t%d\n", number, number*number, number*number*number);
number = number+1;
printf("%d\t%d\t%d\n", number, nu ...
//c how to program 习题2.30
#include <stdio.h>
int main( void )
{
printf("请输入一个5位的整数:");
int number, temp;
scanf("%d", &number);
int a, b, c, d, e;
temp = number;
a = temp / 10000;
temp = number % 10000;
b = temp / 1000 ...