owe0.c
来自「linux下的C语言开发」· C语言 代码 · 共 25 行
C
25 行
/*-*//******************************************************** * Question: * * Why does the following program print out * * "You owe nothing" even when you owe something? * ********************************************************//*+*/#include <stdio.h>char line[80]; /* input line */int balance_owed; /* amount owed */int main(){ printf("Enter number of dollars owed:"); fgets(line, sizeof(line), stdin); sscanf(line, "%d", &balance_owed); if (balance_owed = 0) printf("You owe nothing.\n"); else printf("You owe %d dollars.\n", balance_owed); return (0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?