網頁

2017年3月7日 星期二

ex2 基本int輸入輸出與dev C++ 5.11




輸入n=5

輸出如下:
1
12
123
1234
12345

27 則留言:

  1. B10333070 徐承瑋2017年3月7日 上午10:32

    include <iostream>

    using namespace std;

    int main()
    {
    int n;
    cin >> n;
    for(int i=1;i<=n;i++)
    {
    for (int j=1;j<=i;j++)
    cout<<j;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  2. B10333107-曾詠浩2017年3月7日 上午10:33

    #include <iostream>

    using namespace std;

    int main()
    {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  3. B10333027毛冠霖2017年3月7日 上午10:35

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  4. b10233032謝翔宇2017年3月7日 上午10:38

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop
    system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<'i';
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  5. B10333063 羅胤銓2017年3月7日 上午10:38

    #include <iostream>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  6. B10333081曹正諭(正版)2017年3月7日 上午10:38

    #include <iostream>
    #include <cstdlib>>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  7. B10333077潘家銘2017年3月7日 上午10:39

    #include <iostream>
    #include <cstdlib>
    using namespace std;

    int main(int argc, char** argv)
    {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1;i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  8. B10333083 周琬芸2017年3月7日 上午10:40

    #include <iostream>
    #include<cstdlib>
    using namespace std;;
    /* run this program sing the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin >> n;
    for (int j = 1; j <= n; j++)
    {
    for (int i = 1; i <= j; i++)
    cout << i;
    cout << endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  9. B10333106 劉郁芃2017年3月7日 上午10:41

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this progrom using the console pauser or add your own getch,
    system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  10. B10333086 陳晏堂2017年3月7日 上午10:41

    #include<iostream>
    #include<cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch,
    system("pause") or input loop*/

    int main(int argc, char** argv) {
    int n;
    cin >> n;
    cout << n << endl;
    for (int j = 1; j<= n; j++)
    {
    for (int i = 1; i <= j; i++)
    cout << i;
    cout << endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  11. B10333064王韻菱2017年3月7日 上午10:41

    #include <iostream>
    #include <cstdlib>
    using namespace std;

    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  12. B10333005 陳於農2017年3月7日 上午10:41

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }


    system("pause");
    return 0;
    }

    回覆刪除
  13. B10333072 黃玟茜2017年3月7日 上午10:42

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch,
    system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  14. #include <iostream>
    #include <cstdlib>
    using namespace std;


    int main(int argc, char** argv) {
    int n;
    cin>>n;

    for(int j=1; j<=n; j++)

    {
    for(int i=1; i<=j ;i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  15. B10333055 翁恩義2017年3月7日 上午10:43

    #include <iostream>
    #include <cstdlib>

    using namespace std;

    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv)
    {
    int n;
    cin>>n;

    for(int j=1;j<=n;j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  16. B10333079 葉禮魁2017年3月7日 上午10:43

    #include <iostream>
    #include <cstdlib>
    using namespace std;

    int main(int argc,char** argv)
    {
    int n;
    cin>>n;

    for(int j=1 ; j<=n ; j++)
    {
    for(int i=1; i<=j ; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;

    }

    回覆刪除
  17. b10333097胡聖恩2017年3月7日 上午10:44

    #include <iostream>
    #include <cstdlib>
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */
    using namespace std;
    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除
  18. #include <iostream>
    #include <cstdlib>

    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {

    int n;
    cin>>n;
    cout<<n<<endl;

    for(int i=1;i<=n;i++)
    {

    for(int j=1;j<=i;j++)
    cout<<j;
    cout<<endl;
    }


    system("pause");
    return 0;
    }

    回覆刪除
  19. B10433053謝肇安2017年3月7日 上午10:49

    #include <iostream>

    using namespace std;

    int main(int arc, char** argv){
    int n;
    cin>>n;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;

    }

    回覆刪除
  20. B10433038詹恭煒2017年3月7日 上午10:49

    #include <iostream>

    using namespace std;

    int main(int arc, char** argv){
    int n;
    cin>>n;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;
    }
    system("pause");
    return 0;

    }

    回覆刪除
  21. #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }


    system("pause");
    return 0;
    }

    回覆刪除
  22. B10333053 梁竣翔2017年3月7日 上午11:02

    #include <iostream>
    #include <cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {
    int n;
    cin>>n;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<i;
    cout<<endl;
    }


    system("pause");
    return 0;
    }

    回覆刪除
  23. #include <iostream>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */

    int main(int argc, char** argv) {

    int n;
    cin>>n;
    cout<<n<<endl;
    for (int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<'$';
    cout<<endl;
    }
    system("pause");
    return 0;

    }

    回覆刪除
  24. #include <iostream>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop */


    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1;j<=n;j++)
    {
    for(int i=1;i<=j;i++)
    cout<<j;
    cout<<endl;
    }
    return 0;
    }

    回覆刪除
  25. B10333001黃子安2017年3月7日 上午11:08

    #include <iostream>
    #include<cstdlib>
    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop
    system("pause") or input loop */
    int main(int argc, char** argv) {
    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n;j++)
    {
    for(int i=1; i<=j; i++)
    cout<<'i';
    cout<<endl;

    }
    system("pause");
    return 0;

    }

    回覆刪除
  26. b10133187 楊鈞文2017年3月7日 上午11:10

    #include <iostream>
    #include <cstdlib>


    using namespace std;
    /* run this program using the console pauser or add your own getch, system("pause") or input loop
    system("pause") or input loop */
    int main(int argc,char** arcgv){

    int n;
    cin>>n;
    cout<<n<<endl;
    for(int j=1; j<=n; j++)
    {
    for(int i=1; i<=j; i++)
    cout<<i;
    cout<<endl;


    }
    system("pause");
    return 0;
    }

    回覆刪除
  27. B10333089 游智翔2017年3月14日 上午11:26

    include <iostream>

    using namespace std;

    int main()
    {
    int n;
    cin >> n;
    for(int i=1;i<=n;i++)
    {
    for (int j=1;j<=i;j++)
    cout<<j;
    cout<<endl;
    }
    system("pause");
    return 0;
    }

    回覆刪除

HTML 編輯器