Skip to content

Commit df53263

Browse files
added 4 problems
1 parent 71f37f8 commit df53263

File tree

4 files changed

+99
-0
lines changed

4 files changed

+99
-0
lines changed

BIRDFARM.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
// your code goes here
6+
int t,x,y,z;
7+
cin>>t;
8+
while(t--)
9+
{
10+
cin>>x>>y>>z;
11+
if(z%x==0 && z%y==0)
12+
cout<<"ANY\n"<<endl;
13+
14+
else if(z%x==0)
15+
cout<<"CHICKEN\n"<<endl;
16+
17+
else if(z%y==0)
18+
cout<<"DUCK\n"<<endl;
19+
20+
else
21+
cout<<"NONE\n"<<endl;
22+
}
23+
return 0;
24+
}

SST.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
// your code goes here
6+
int t,a,b,x,y;
7+
cin>>t;
8+
while(t--)
9+
{
10+
cin>>a>>b;
11+
x=(a*100)/10;
12+
y=(b*100)/20;
13+
if(x>y)
14+
cout<<"FIRST"<<endl;
15+
else if(x<y)
16+
cout<<"SECOND"<<endl;
17+
else
18+
cout<<"ANY"<<endl;
19+
20+
}
21+
return 0;
22+
}

SUMNEQ.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
// your code goes here
6+
int i,n,j,count=0;
7+
cin>>n;
8+
if(n==1)
9+
{
10+
cout<<'0';
11+
exit;
12+
}
13+
else{
14+
15+
for(i=1; i<n;i++)
16+
{
17+
for(j=1; j<n; j++)
18+
{
19+
;
20+
if((i+j)==n)
21+
count++;
22+
}
23+
}
24+
cout<<count;
25+
}
26+
return 0;
27+
}

TEA.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
// your code goes here
6+
int t,x,y,z,n;
7+
cin>>t;
8+
while(t--)
9+
{
10+
int count=0;
11+
cin>>x>>y>>z;
12+
if(x<=y)
13+
cout<<z<<endl;
14+
else
15+
{
16+
n=0;
17+
while(n<x)
18+
{
19+
n=n+y;
20+
count++;
21+
}
22+
cout<<count*z<<endl;
23+
}
24+
}
25+
return 0;
26+
}

0 commit comments

Comments
 (0)