10071 - Back to High School Physics

All about problems in Volume 100. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

rahat khan
New poster
Posts: 10
Joined: Mon May 23, 2011 1:12 pm

Re:10071 Back to High School Physics

Post by rahat khan »

#include<stdio.h>
int main()
{
int s,v,t;
scanf("%d %d",&v,&t);
s=v*t;
s=s*2;
printf("%d\n",s);
return 0;
}
nova4409
New poster
Posts: 1
Joined: Mon Nov 04, 2013 11:57 am

Re: Re:10071 Back to High School Physics

Post by nova4409 »

#include <iostream>
using namespace std;

int main(){
int v,t,s;
while(scanf("%d %d",&v,&t)==2){
if(0<=t<=200 && -100<=v<=100){
s=v*t*2;
cout<<s<<endl;
}}

}
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: Re:10071 Back to High School Physics

Post by brianfry713 »

That code won't compile.
Check input and AC output for thousands of problems on uDebug!
liya
New poster
Posts: 10
Joined: Fri Jan 23, 2015 2:36 pm

Re: Which problem is the easiest problem of this site?

Post by liya »

prob no:10071....it's getting RE....what's the problem?here is my code.....

Code: Select all

#include<stdio.h>
int main()
{
   int v,t,s;
   while((scanf("%d %d",&v,&t))!=EOF)
   {
       s=v*t*2;
   printf("%d\n",s);
   }



}
Last edited by brianfry713 on Fri Jan 23, 2015 9:39 pm, edited 1 time in total.
Reason: Added code blocks
brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10071 - Back to High School Physics

Post by brianfry713 »

Next time post in the correct thread.
Try adding return 0; at the end of your code.
Check input and AC output for thousands of problems on uDebug!
Post Reply

Return to “Volume 100 (10000-10099)”