• LQDOJ
  • Trang chủ
  • Bài tập
  • Bài nộp
  • Thành viên
  • Kỳ thi
  • Nhóm
  • Giới thiệu
    • Status
    • Khóa học
    • Đề xuất ý tưởng
    • Proposal Problem
    • Proposal Contest
    • Tools
    • Báo cáo tiêu cực
    • Báo cáo lỗi

Tiếng Việt

Tiếng Việt
English

Đăng nhập

Đăng ký

quocdattran445

  • Giới thiệu
  • Bài tập
  • Bài nộp

Rating
-
Bài tập
5
Điểm
5909
Rating #
-
Điểm #
15323

Giới thiệu

include <bits/stdc++.h>

using namespace std;
string tao(char a, int l){
string s ="";
for(int i =0;i<l;i++){ s+= a; } return s; } int main(){ ios_base::sync_with_stdio(false); cout.tie(nullptr);cin.tie(nullptr); string s; cin>>s;
string k = tao(s[0],s.length());
if(k<s)
k = tao(char(int(s[0]-'0')+1+'0'),s.length());
cout<<stoll(k) - stoll(s);
return 0;
}


«    »
Thứ 2
Thứ 3
Thứ 4
Thứ 5
Thứ 6
Thứ 7
CN
Ít
Nhiều

proudly powered by DMOJ| developed by LQDJudge team