Pages

Thursday, September 17, 2009

UVA Problem#11185

Question:

Solution Techniques:
 1. take input.
2. use the following formula to get the ternary of the number

ternary[i] = decimal%3; 
decimal = decimal/3; 
i++;

3. Show the output. 

UVA Problem#10071

#include <stdio.h>

int main(){
int v, t;
while(scanf("%d%d", &v, &t)==2)
printf("%d\n", 2*v*t);
return 0;
}