My issue
My code
#include <stdio.h>
int main(void) {
int T;
scanf("%d",&T);
int X;
scanf("%d",&X);
return 0;
}
Problem Link: RANKLISTPAGE Problem - CodeChef
#include <stdio.h>
int main(void) {
int T;
scanf("%d",&T);
int X;
scanf("%d",&X);
return 0;
}
Problem Link: RANKLISTPAGE Problem - CodeChef
include
using namespace std;
int main() {
int t;
cin>>t;
while(t–){
int x;
cin>>x;
if(x%25==0){
cout<<x/25<<endl;
}
else
cout<<x/25+1<<endl;
}
return 0;
}
include
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t–){
int n;
cin>>n;
if(n%25==0){
cout<<n/25<<endl;
}
else{
cout<<(n/25)+1<<endl;
}
}
return 0;
}
include <stdio.h>
int main(void) {
// your code goes here
int testcase;
scanf(“%d”,&testcase);
while(testcase–){
int val;
scanf("%d",&val);
if(val%25==0){
printf("%d\n",val/25);
}
else
printf("%d\n",(val/25)+1);
}
return 0;
}
@nithyaaa03
Here, the logic i applied was like this;
Till the number is bigger than 25, we subtract 25 from the number x and keep count of number of subtractions made. Initialize the counter (c==1) as for x ranging from 1 to 25, page number is 1.
The final page number is then printed.
#include <stdio.h>
int main(void)
{
int t;
scanf("%d",&t);
while(t--)
{
int x,c=1;
scanf("%d",&x);
while(x>25)
{
x=x-25;
c++;
}
printf("%d\n",c);
}
return 0;
}
include <stdio.h>
int main(void) {
// your code goes here
int t;
scanf(“%d”,&t);
while(t–){
int x;
scanf(“%d”,&x);
if(x%25==0){
printf(“%d\n”,x/25);
}
else{
printf(“%d\n”,(x/25)+1);
}
}
return 0;
}