Friday, April 29, 2016

UVA problem 10071 – Back to High School Physics

Problem link (Click here)

#include<stdio.h>

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



URI Problem 1018-Banknotes

Problem link (Click here)


#include <stdio.h>

int main()
{
    int input , hundred ,fifty , twenty , ten ,five , two ,one ;
    scanf("%d",&input);
    hundred=(input/100);
    fifty= (input-(hundred*100))/50;
    twenty=(input-((hundred*100)+(fifty*50)))/20;
    ten=(input-((twenty*20)+(fifty*50)+(hundred*100)))/10;
    five=(input-((ten*10)+(twenty*20)+(fifty*50)+(hundred*100)))/5;
    two=(input-((five*5)+(ten*10)+(twenty*20)+(fifty*50)+(hundred*100)))/2;
    one=input-((two*2)+(five*5)+(ten*10)+(twenty*20)+(fifty*50)+(hundred*100));
    printf("%d\n",input);
    printf("%d nota(s) de R$ 100,00\n",hundred);
    printf("%d nota(s) de R$ 50,00\n",fifty);
    printf("%d nota(s) de R$ 20,00\n",twenty);
    printf("%d nota(s) de R$ 10,00\n",ten);
    printf("%d nota(s) de R$ 5,00\n",five);
    printf("%d nota(s) de R$ 2,00\n",two);
    printf("%d nota(s) de R$ 1,00\n",one);

    return 0;
}



Hello world! Example Program

#include <cstdio>

int main()
{
        printf (" Hello World ");
        return 0;
}