#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;
}
10071 - Back to High School Physics
Moderator: Board moderators
-
- New poster
- Posts: 10
- Joined: Mon May 23, 2011 1:12 pm
Re: Re:10071 Back to High School Physics
#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;
}}
}
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;
}}
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: Re:10071 Back to High School Physics
That code won't compile.
Check input and AC output for thousands of problems on uDebug!
Re: Which problem is the easiest problem of this site?
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
Reason: Added code blocks
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10071 - Back to High School Physics
Next time post in the correct thread.
Try adding return 0; at the end of your code.
Try adding return 0; at the end of your code.
Check input and AC output for thousands of problems on uDebug!