Codeforces Solution

Discover valuable insights and strategies for unlocking Codeforces Solution like a pro coder.

Codeforces 110A Nearly Lucky Number Solution

Codeforces 110A Nearly Lucky Number Solution in CPP

Question link: Codeforces 110A Nearly Lucky Number solution in CPP #include<bits/stdc++.h> using namespace std; int main() { string a; int c=0,z=0; cin>>a; for(int i=0;i<a.size();i++) { if(a[i]==’4’||a[i]==’7′)//Codeforces 110A Nearly Lucky Number solution in CPP c++; } if(c==4||c==7) cout<<“YES”<<endl; else cout<<“NO”<<endl; } Codeforces 734A.Anton and Danik solution in Cpp

Codeforces 977A Wrong Subtraction solution in CPP

Codeforces 977A Wrong Subtraction solution in CPP

Question link: Codeforces 977A Wrong Subtraction solution in CPP Wrong Subtraction #include<bits/stdc++.h> using namespace std; int main() { int n,k,r=0; cin>>n>>k; for(int i=1;i<=k;i++) { r=n%10; if(r==0) { n/=10; } else { n=n-1; } } cout<<n; } Code Explanation This is a C++ code that takes two integers n and k as input from the user, …

Codeforces 977A Wrong Subtraction solution in CPP Read More »

Codeforces 59AWord Solution

Codeforces 59AWord Solution in C/CPP

Codeforces 59AWord Solution question Codeforces 59AWord Solution in CPP #include<iostream> #include<string> #include<algorithm> using namespace std; int main() { string a; int l=0,u=0; cin>>a; for(int i=0;i<a.size();i++) { if(a[i]>=’a’&& a[i]<=’z’) { l++; } else u++; } if(l>=u){ for(int i=0;i<a.size();i++)//Codeforces 59A.Word Solution a[i]=tolower(a[i]); cout<<a<<endl; } else { for(int i=0;i<a.size();i++) { a[i]=toupper(a[i]); } cout<<a<<endl; } } Codeforces 59AWord Solution …

Codeforces 59AWord Solution in C/CPP Read More »

Elephant Codeforces

Elephant Codeforces || Codeforces 617A Elephant solution in C++

Codeforces Elephant Question Elephant Codeforces solution in C++ An elephant decided to visit his friend. It turned out that the elephant’s house is located at point 0 and his friend’s house is located at point x(x > 0) of the coordinate line. In one step the elephant can move 1, 2, 3, 4 or 5 positions forward. Determine, what is the minimum number of steps he need to …

Elephant Codeforces || Codeforces 617A Elephant solution in C++ Read More »

Codeforces 546A Soldier and Bananas solution in C++

Codeforces 546A Soldier and Bananas solution in C++

Codeforces 546A. Soldier and Bananas Question A. Soldier and Bananas A soldier wants to buy w bananas in the shop. He has to pay k dollars for the first banana, 2k dollars for the second one and so on (in other words, he has to pay i·k dollars for the i-th banana). He has n dollars. How many dollars does he have to borrow from his …

Codeforces 546A Soldier and Bananas solution in C++ Read More »

Scroll to Top
NEW TOXIC ROCKET CYCLE DECK in Clash Royale 2023 Best Deck in Clash Royale Best Deck for Arena 8 in Clash Royale Best Hog deck for Pro players Best Clash Royale Deck