Codeforces 110A Nearly Lucky Number Solution in CPP

Codeforces 110A Nearly Lucky Number Solution

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, … Read more

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

Elephant Codeforces

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 … 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 … Read more

Codeforces Bear and Big Brother solution

Codeforces Problem 791/A. Bear and Big Brother solution with CPP

Codeforces Problem 791/A. Bear and Big Brother solution with CPP 100% Accepted Before seeking assistance, it is advisable to make an effort to solve the problem yourself. This can involve researching the problem online, reviewing relevant documentation, and attempting to apply your knowledge to find a solution. By trying to solve the problem first, you … Read more

Word capitalization codeforces solution

word capitalization codeforces solution

Word capitalization codeforces solution Codeforces 281A. Word Capitalization Solution in C #include <stdio.h> #include <string.h> int main() { char s[101]; scanf(“%s”, s); s[0] = toupper(s[0]); printf(“%s\n”, s); return 0; } Codeforces 281A. Word Capitalization Solution in CPP #include<iostream> #include<string>using namespace std; int main() { string s; cin>>s; s[0]=towupper(s[0]); cout<<s; } Codeforces 791/A. Bear and Big … Read more

Domino Piling solution in C | Codeforces 50A. Domino piling solution

domino piling solution in c

Domino Piling Solution in C | Codeforces 50A. Domino piling solution Question A. Domino piling You are given a rectangular board of M × N squares. Also you are given an unlimited number of standard domino pieces of 2 × 1 squares. You are allowed to rotate the pieces. You are asked to place as many dominoes as possible on the board so … Read more

Codeforces next round solution in C,Python || Codeforces 158A. Next Round Solution

codeforces next round solution in c

Codeforces next round solution in C,Python QUESTION 158A. Next Round Solution solution in C #include<stdio.h> int main() { int n,i,k,count=0; int a[100]; scanf(“%d%d”,&n,&k); for(i=0;i<n;i++){ scanf(“%d”,&a[i]);} k=k-1; for(i=0;i<n;i++){ if(a[i]>=a[k]&&a[i]>0){ count++; } } printf(“%d\n”,count); return 0; } 158A. Next Round Solution in Python n,k = map(int,raw_input().split()) L = map(int,raw_input().split()) temp = L[k-1] count=0 for i in range(0,len(L)): … Read more

1A.Theatre square Codeforces Solution in C, CPP, Python

Theatre square Codeforces Solution

Theatre square Codeforces solution || Codeforces theatre square solution Theatre square Solution in C, CPP, Python Question Cover a square with tiles — Codeforces Problem “Theatre Square” We are given a square of size n x m the square has side large cells, and we can place only square tiles on it also each tile … Read more