亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這是一個輸入年,月,日,名字,收入后打印出一條信息的程序,請問該怎么改?

這是一個輸入年,月,日,名字,收入后打印出一條信息的程序,請問該怎么改?

皈依舞 2022-06-29 15:11:47
#include <stdio.h>#include <stdlib.h>#define MAX 100#define YES 1#define NO 0struct record {char fname[15+1];char lname[20+1];char phone[9+1];long income;int month;int day;int year;};struct record list[MAX];int last_entry = 0;int main(void);void get_data(void);void display_report(void);int continue_function(void);void clear_kb(void);int main( void ){int cont = YES;int ch;while( cont == YES ){printf( "\n");printf( "\n MENU");printf( "\n ========\n");printf( "\n1. Enter names");printf( "\n2. Print report");printf( "\n3. Quit");printf( "\n\nEnter Selection ==> ");ch = getchar();fflush(stdin); /* remove extra characters from keyboard buffer */switch( ch )
查看完整描述

2 回答

?
SMILET

TA貢獻1796條經驗 獲得超4個贊

for ( cont = YES; last_entry < MAX && cont == YES;last_entry++ )
看到這個循環了么 如果執行到這里 last_entry就變化了

查看完整回答
反對 回復 2022-07-05
?
慕尼黑的夜晚無繁華

TA貢獻1864條經驗 獲得超6個贊

for ( cont = YES; last_entry < MAX && cont == YES;last_entry++ )這句中把last_entry的值修改了,該變量的值大于等于1,小于等于MAX。

查看完整回答
反對 回復 2022-07-05
  • 2 回答
  • 0 關注
  • 148 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號