File tree Expand file tree Collapse file tree 4 files changed +99
-0
lines changed
Expand file tree Collapse file tree 4 files changed +99
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments