c primer plus 第五版 的源代码

源代码在线查看: break.c

软件大小: 284 K
上传用户: guo25621286
关键词: primer plus 源代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* break.c -- uses break to exit a loop */
				#include 
				int main(void)
				{
				    float length, width;
				
				    printf("Enter the length of the rectangle:\n");
				    while (scanf("%f", &length) == 1)
				    {
				        printf("Length = %0.2f:\n", length);
				        printf("Enter its width:\n");
				        if (scanf("%f", &width) != 1)
				            break;
				        printf("Width = %0.2f:\n", width);
				        printf("Area = %0.2f:\n", length * width);
				        printf("Enter the length of the rectangle:\n");
				    }
				    printf("Done.\n");
				   
				    return 0;
				}
							

相关资源