循環嵌套,邏輯程式中常用的種方法,不僅在C語言編程中用到,在卡西歐科學計算器中也常能用到的邏輯語言。在一個循環體語句中又包含另一個循環語句,稱為循環嵌套
#include<iostream>//這是c++版的格式using namespace std;int main(){ int c=0; for(int i=0;i<=10;i++) { for(int t=0;t<=10;t++) { c=c+t+i; cout<<c<<endl; } } }具體結果如下013610152128364555565861657076839110011012112312613013514114815616517518619820120521021622323124025026127328629029530130831632533534635837138539039640341142043044145346648049550150851652553554655857158560061662363164065066167368670071573174875676577578679881182584085687389190091092193394696097599110081026104510551066107810911105112011361153117111901210--------------------------------Process exited with return value 0Press any key to continue . . .