Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
HT thai an
Xem chi tiết
Lê Chiêu Nguyên	Vũ
Xem chi tiết
Nguyễn Thảo Vy
Xem chi tiết
LA VAN CAU
Xem chi tiết
NgocTuan
Xem chi tiết
Nguyễn Lê Phước Thịnh
23 tháng 1 2022 lúc 20:08

#include <bits/stdc++.h>

using namespace std;

string st;

int d,i;

int main()

{

getline(cin,st);

d=st.length();

for (i=0; i<=d-1; i++)

if ((st[i]==' ') and (st[i+1]=' ')) st.erase(i,1);

cout<<st;

return 0;

}

feng
Xem chi tiết
nguyễn an phát
24 tháng 5 2022 lúc 10:59

program bai1;
uses crt;
var i:integer;
s,s1:string;
begin
  clrscr;
  write('nhap S:');readln(s);
  while pos('C',s)<>0 do
  begin
    insert('LOP11A',s,pos('C',s));
    delete(s,pos('C',s),1);
  end;
  writeln('xau sau khi bien doi la: ',s);
  writeln('do dai cua xau tren la: ',length(s));
  write('nhap s1:');readln(s1);
  if s1[1]=s[1] then writeln('ki tu dau cua hai xau trung nhau')
  else writeln('ki tu dau cua hai xau khong trung nhau');
  readln;
end.

No_pvp
Xem chi tiết
Phía sau một cô gái
10 tháng 7 2023 lúc 20:12

#include <iostream>

using namespace std;

int main() {

       string A, B;

       getline(cin, A);

       getline(cin, B);

       int count = 0;

       for (int i = 0; i <= B.length() - A.length(); i++) {

              bool found = true;

              for (int j = 0; j < A.length(); j++) {

                     if (B[i+j] != A[j]) {

                            found = false;

                            break;

                     }

              }

              if (found) {

                     count++;

              }

       }

       cout << count;

       return 0;

}

No_pvp
Xem chi tiết
Hello1234
Xem chi tiết

#include<bits/stdc++.h>
using namespace std;
int main(){
long long i,dem[1000],d;
string s;
cin >>s;
for(i=0;i<s.size();i++)
    dem[s[i]]++;
d=0;
for(i=97;i<=122;i++)
   if(dem[i]%2==1)
      d++;
if(d>0)
    cout<<d-1;
else
    cout<<0;
return 0;
}