[Làm Quen OJ]. Bài 9. Xóa số

View as PDF

Submit solution


Points: 1.00
Time limit: 1.0s
Memory limit: 256M
Input: stdin
Output: stdout

Problem source:
28Tech
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch

Cho số nguyên dương N có ít nhất 5 chữ số, nhiệm vụ của bạn là xóa đi 3 chữ số cuối cùng của N và in ra những chữ số còn lại. Ví dụ N = 12345 sau khi xóa đi 3 chữ số cuối cùng thì N = 12

Gợi ý : Muốn xóa chữ số cuối cùng thì lấy N / 10, 2 chữ số cuối lấy N / 100....


Đầu vào

Dòng duy nhất chứa số nguyên dương N


Ràng buộc

10000<=N<=10^18


Đầu ra

In ra N sau khi xóa đi 3 chữ số cuối cùng


Ví dụ

Input 01
999999999999993728
Output 01
999999999999993

Comments

Please read the guidelines before commenting.



  • 0
    MrDamVinhHung  commented on Jan. 7, 2026, 3:20 p.m.

    include <bits/stdc++.h>

    using namespace std;
    int main() {
          ios_base::sync_with_stdio(false);
          cin.tie(NULL);
          string s;
          cin >> s;
          s.pop_back();
          s.pop_back();
          s.pop_back();
          cout << s;
          return 0;}
    

  • 0
    dinh_tin_392  commented on Jan. 6, 2026, 4:49 a.m.

    python

    n=int(input()) print(n//1000)


  • -1
    Youtuber_TWK  commented on Nov. 28, 2025, 11:52 a.m.

    ohio


  • -2
    L8_DuongThanhKhiem  commented on Nov. 22, 2025, 3:57 a.m.

    FULL AC:

    #include <bits/stdc++.h>
    using namespace std;
    long long n;
    int main(){
        cin >> n;
        cout << n / 1000;
        return 0;
    }
    

  • -3
    vanscend  commented on Aug. 20, 2025, 6:20 p.m.

    mé mấy bài đầu toàn tạo hàm xong gọi


  • 0
    nduc1907  commented on July 4, 2025, 3:16 a.m.

    nhập số nguyên N rồi lấy N chia 1000 thui :3


  • 0
    bengokyeuanh99  commented on April 6, 2025, 11:24 a.m.

    include <iostream>

    int main() { long long N; std::cin >> N; std::cout << N / 1000 << '\n'; return 0; }


  • -4
    fuchs  commented on May 27, 2024, 6:11 p.m.

    public class Main{ public static void main(String[] args) { try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

            long n = Long.parseLong(reader.readLine());
    
            long lastThreeDigits = n / 1000;
    
    
            System.out.print(lastThreeDigits);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    }
    

  • -7
    imamen2005  commented on May 23, 2024, 6:56 a.m.

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


  • -3
    __lvhoa__  commented on May 21, 2024, 8:05 a.m.

    include <bits/stdc++.h>

    using namespace std; typedef long long ll; typedef long double lb; //const ; //Khai bao

    //Ham

    int main() { iosbase::syncwith_stdio(false); cin.tie(NULL); cout.tie(NULL); //freopen(".INP", "r", stdin); //freopen(".OUT", "w", stdout); string s; getline(cin ,s); string s1=s.substr(0,s.size()-3); cout << s1; return 0; }


  • -6
    Itachi  commented on April 30, 2024, 7:40 a.m.

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