看板 C_and_CPP 關於我們 聯絡資訊
不是 meta programming... 單純只是用 valarry 這個大家都遺忘的東西 #include <valarray> #include <iostream> using namespace std; int main() { valarray<int> l(9),r(9),tmp(9); for(int i=0; i<9; i++) r[i] = i+1; for(int i=1; i<= 9; i++){ l = i; tmp = l*r; for(int j=0; j<9;j++) cout<<l[j]<<"x"<<r[j]<<"="<<tmp[j]<<"\t"; cout<<"\n"; } return 0; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.39.29.29 ※ 編輯: adxis 來自: 114.39.29.29 (02/02 21:04)
freedomxu:個人覺得已經不是在為9x9乘法表coding了… 02/02 23:19
freedomxu:不過這是C program版,請別把我個人的評論放心上… 02/02 23:21
adxis:可以看看c語言程式求助系列 XD 02/02 23:44
VictorTom:變成: "[求救] 用 C++ 寫九九乘法表" 的創意寫法集了XD 02/03 00:01