Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HuxleyCode {
- public static double p(int x, int y) {
- if(y==1){
- return x;
- }else{
- return x+p(x,y-1);
- }
- }
- public static void main(String args[]) {
- Scanner s = new Scanner(System.in);
- int QuantCorda = s.nextInt();
- int QuantMoeda = s.nextInt();
- int CustoCorda = s.nextInt();
- if(p(QuantCorda,CustoCorda)>=CustoCorda){
- System.out.print("Sim");
- }else{
- System.out.print("Não");
- }
- }
- }
Add Comment
Please, Sign In to add comment