看板 ILSH-94313 關於我們 聯絡資訊
※ 引述《chenbojyh (阿志)》之銘言: : Write a program to process a collection of daily high temperatures. :   : Your program should count and print the number of hot days : (temperature >= 85 degree), the number of pleasant days : (degree between 60-84), and the number of cold days (degree <=60). : It should also display the category of each temperature. Test your : program on the following data: :   : 55 62 68 74 59 45 41 58 60 67 62 78 82 88 91 92 90 93 87 80 78 79 72 68 61 59 : 哪位善心人士 : 幫個忙吧!! : 就以目前我會的東西 : 我寫不出來....... : 潘老師!對不起.......... 有善心人士寫了!! 感謝妳 ^^ 可是..... 看不懂........(泣).......真丟臉...... --- #include <iostream> using namespace std; int main() { int num_hot_days = 0, num_pleasant_days = 0, num_cold_days = 0; int temperatures; while( cin >> temperatures){ if( temperatures >= 85){ ++num_hot_days; }else if( temperatures >= 61){ ++num_pleasant_days; }else{ ++num_cold_days; } } cout << "hot days: " << num_hot_days << endl; cout << "pleasant days: " << num_pleasant_days << endl; cout << "cold days: " << num_cold_days << endl; return 0; } ---- 問題: iostream using namespace std; cin cout 這些動作........ 都沒教過.....(泣) 唉......... 教教我這些是做啥的呀......? >\\\\\\\\<丟臉死了...... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.123.220.101
iceboxi:C++不熟...不過那應該是指使用標準程式庫 01/02 21:30
iceboxi:還是你要C? 01/02 21:31
chenbojyh:都可.....最主要是要教會我..... 01/02 21:33
chenbojyh:感恩..... 01/02 21:33
iceboxi:....那等等吧...我寫好噹你 01/02 21:35
chenbojyh:上面這程式........應該是沒寫完....只有寫主體..... 01/02 21:37
sailorpow:cin cout不是程式最基本的嗎...連在下這沒用過++的都看ꨠ 01/02 21:48
sailorpow:懂~ ++是趨勢, 還是學他比較好吧 01/02 21:48