VL01 - In ra các số từ a đến b

View as PDF

Submit solution

Points: 1.00 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C#, C++, Go, Java, Pascal, Perl, PHP, Python, Ruby, Rust, Scratch, Swift

Để làm quen với vòng lặp, bạn sẽ cần giải quyết bài tập sau:

Viết chương trình in ra các số nguyên trong ~ [a, b] ~

Input

2 số nguyên ~ a ~ và ~ b ~

Giới hạn:

  • ~ -1000 \le a \le b \le 1000 ~

Output

Các số nguyên trong đoạn ~ [a, b] ~ theo thứ tự tăng dần, phân tách nhau bởi 1 dấu cách

Sample

Input #1
2 5
Output #1
2 3 4 5

Comments

Please read the guidelines before commenting.



  • 0
    Banana  commented on Jan. 11, 2025, 3:58 a.m.

    Chúc các bạn thành công.


  • 1
    tinhoc2024  commented on Nov. 30, 2024, 9:45 a.m.

    include <bits/stdc++.h>

    using namespace std; long long a,b; int main() { cin>>a>>b; for(int i=a;i<=b;i++) cout<<i<<" "; }


  • 1
    Thonghoccode  commented on Nov. 26, 2024, 1:38 p.m.

    include <iostream>

    using namespace std;

    int main() { int a, b; cin >> a >> b; while(a <= b){ cout << a << " "; a++; } return 0; }


  • -1
    Phanminhtai_hv  commented on Nov. 14, 2024, 10:17 a.m.


  • -4
    luonghongquang2011  commented on Oct. 30, 2024, 1:37 p.m.

    gugaga


  • 0
    luonghongquang2011  commented on Oct. 30, 2024, 1:32 p.m.

    gugugaga


  • 0
    super_god  commented on Oct. 8, 2024, 2:35 a.m.

    hello ae


  • 0
    BaoAn11_  commented on Oct. 2, 2024, 1:00 p.m.

    include <bits/stdc++.h>

    using namespace std; long long n; int main() { cin >>n; for(int i=1 ; i<=n ; i--) cout << i << " "; return 0; } thay thanhf i++


  • 0
    kietjumper  commented on Aug. 15, 2024, 3:55 a.m.

    //Code by KJP

    #include <bits/stdc++.h>
    using namespace std;
    
    int main() 
    {
     int a, b;
     cin >> a >> b;
     while (a <= b){
       cout<< a << " ";
       a++;
       }
    }
    

    • -1
      bnbnbn  commented on Dec. 14, 2024, 7:46 a.m.

      việc nhà m ak


  • -2
    Docladongnai  commented on March 16, 2024, 10:45 a.m.

    test case 2 nghĩa là gì ạ


    • 2
      dainghiajustiin  commented on March 16, 2024, 11:39 a.m.

      test 2 là a = b đó bạn


      • 0
        kietjumper  commented on Aug. 5, 2024, 3:22 a.m.

        a = b thi tinh sao ak


  • 0
    Docladongnai  commented on March 16, 2024, 10:45 a.m.

    test case 2 nghĩa là gì ạ


  • -8
    triduc_2k9  commented on Nov. 13, 2023, 1:11 p.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


  • -8
    taithikgirl  commented on Oct. 28, 2023, 2:31 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.