Skip to content

Commit 1893744

Browse files
committed
Added A new folder of DSA learning series
1 parent 1b54563 commit 1893744

File tree

7 files changed

+82
-0
lines changed

7 files changed

+82
-0
lines changed
Loading
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Buy Please | Problem Code: BUYPLSE
2+
3+
4+
Chef went to a shop and buys a pens and b pencils. Each pen costs x units and each pencil costs y units. Now find what is the total amount Chef will spend to buy a pens and b pencils.
5+
6+
Input:
7+
First-line will contain 4 space separated integers a, b, x and y respectively
8+
9+
Output:
10+
Print the answer in a new line.
11+
12+
Constraints
13+
1≤a,b,x,y≤103
14+
15+
Sample Input 1:
16+
2 4 4 5
17+
18+
Sample Output 1:
19+
28
20+
Sample Input 2:
21+
1 1 4 8
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int a,b,x,y;
6+
cin>>a>>b>>x>>y;
7+
cout<<(a*x)+(b*y)<<endl;
8+
9+
return 0;
10+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Is Both Or Not | Problem Code: ISBOTH
2+
3+
You're given a number N. If N is divisible by 5 or 11 but not both then print "ONE"(without quotes). If N is divisible by both 5 and 11 then print "BOTH"(without quotes). If N is not divisible by 5 or 11 then print "NONE"(without quotes).
4+
5+
Input:
6+
First-line will contain the number N
7+
Output:
8+
Print the answer in a newline.
9+
Constraints
10+
1≤N≤103
11+
12+
Sample Input 1:
13+
50
14+
Sample Output 1:
15+
ONE
16+
Sample Input 2:
17+
110
18+
19+
EXPLANATION:
20+
In the first example, 50 is divisible by 5, but not 11.
21+
In the second example, 110 is divisible by both 5 and 11.
22+
In the third example, 16 is not divisible by 5 or 11.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int n;
7+
cin>>n;
8+
9+
if(n%5==0 && n%11==0)
10+
{
11+
cout<<"BOTH";
12+
}
13+
if (n%5==0 && n%11!=0 || n%11==0 && n%5!=0 )
14+
{
15+
cout<<"ONE";
16+
17+
}
18+
if(n%5!=0 && n%11!=0)
19+
{
20+
cout<<"NONE";
21+
}
22+
return 0;
23+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
D:\all projects and programs\asasasa\hacktoberfest 7\Data-Structures-and-Algorithms\CodeChef DSA Learning series Solutions\Assets\cc1.jpg
2+
Here I am Uploading All the answers of Codechef DSA learning Series
3+
The main Motive of this repository is to provide solution to those who got stuck somewhere while practicing these Problems
4+
5+
D:\all projects and programs\asasasa\hacktoberfest 7\Data-Structures-and-Algorithms\CodeChef DSA Learning series Solutions\Assets\cc2.jpg
6+

0 commit comments

Comments
 (0)