运行结果:
C语言代码:
/* c how to program 习题3.39 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量x为控制一行*的数量,y为控制*的行数
int x , y = 0;
//当行数 ...
运行结果:
C语言代码:
/* c how to program 习题3.38 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 用户输入的数值number 临时数值temp 累加count
long int number, ...
运行结果:
C语言代码:
/* c how to program 习题3.37 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 number
int number = 0;
//当number为1-100时执行循环
...
运行结果:
C语言代码:
/* c how to program 习题3.36 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 number
long int number = 0;
//当number为1-1000000000时执 ...
运行结果:
C语言代码:
/* c how to program 习题3.35 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量 二进制数值binary 临时数值temp 每位的数值bit 基数factor 十进制数值 ...
运行结果:
C语言代码:
/* c how to program 习题3.34 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int number;
printf("请输入一个5位的整数:");
...
运行结果:
C语言代码:
/* c how to program 习题3.33 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int side, x, y;
//获取边长
printf("请输入正方形的边长1-20 ...
运行结果:
C语言代码:
/* c how to program 习题3.32 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
//定义变量
int side, x, y;
//获取边长
printf("请输入正方形的边长 ...
运行结果:
C语言代码:
/* c how to program 习题3.30 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
int x, y;
printf("请输入x的值:");
scanf("%d", &x);
printf(" ...
(a)运行结果:
(a) C语言代码:
/* c how to program 习题3.30 */
#include <stdio.h>
// function main begins program execution
int main( void )
{
int x, y;
int z = 1;
while( z ){
printf("请输入x的值 ...