Ads

Showing posts with label C language URI Online Judge. Show all posts
Showing posts with label C language URI Online Judge. Show all posts

Monday, May 11, 2020

URI Online Judge 1010 Simple Calculate Solution

URI Online Judge | 1010
Simple Calculate
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1


Problem Description:

Problem Number:1010
Problem Name: Simple Calculate
Author’s Name:Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1010
Solution in C


#include <stdio.h>
int main()
{
    int a,b,c,d;
    double e,f,g;
    scanf ("%d %d %lf", &a,&b,&e);
    scanf ("%d %d %lf", &c,&d,&f);
    g=(b*e)+(d*f);
    printf ("VALOR A PAGAR: R$ %.2lf\n",g);
    return 0;
}

URI Online Judge 1009 Salary with Bonus Solution

URI Online Judge | 1009
Salary with Bonus
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1


Problem Description:

Problem Number:1009
Problem Name: Salary with Bonus
Author’s Name:Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1009
Solution in C


#include <stdio.h>
int main()
{
    char M[100];
    scanf ("%s", M);
    double x,y,z;
    scanf("%lf %lf", &x,&y);
    z=x+(y*15)/100;
    printf ("TOTAL = R$ %.2lf\n",z);
    return 0;
}




URI Online Judge 1008 Salary Solution

URI Online Judge | 1008
Salary
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1


Problem Description:

Problem Number:1008
Problem Name: Salary
Author’s Name:Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1008
Solution in C


#include<stdio.h>
int main()
{
    int n,d;

    float h;

    double a;

    scanf("%d %d %f",&n,&d,&h);

    a=d*h;

    printf("NUMBER = %d\n",n);

    printf("SALARY = U$ %0.2lf\n",a);

    return 0;
}

Saturday, May 9, 2020

URI Online Judge 1007 Difference Solution

URI Online Judge | 1007
Difference
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1


Problem Description:

Problem Number:1007
Problem Name: Difference
Author’s Name:Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1007
Solution in C
Read on-> কম্পিউটারে মাইক্রোফোন কাজ না করলে কি করবেন -Windows 7

#include <stdio.h>
int main()
{
    int A,B,C,D,DIFERENCA;
    scanf ("%d %d %d %d", &A,&B,&C,&D);
    DIFERENCA=(A*B)-(C*D);
    printf("DIFERENCA = %d\n", DIFERENCA);
    return 0;
}





URI Online Judge 1006 Average 2 Solution

URI Online Judge | 1006
Average 2
Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1


Problem Description:

Problem Number:1006
Problem Name: Average 2
Author’s Name:Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1006
Solution in C


#include <stdio.h>
int main()
{
    double A,B,C, MEDIA;
    scanf ("%lf %lf %lf", &A, &B, &C);
    MEDIA= ((A*2)+(B*3)+(C*5))/10;
    printf ("MEDIA = %.1lf\n", MEDIA);
    return 0;
}






URI Online Judge 1005 Average 1 Solution in C

URI Online Judge | 1005
Average 1
Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1


Problem Description:

Problem Number:1005
Problem Name: Average 1
Author’s Name:Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1005
Solution in C


#include <stdio.h>
int main()
{  
   double A,B, MEDIA;
   scanf ("%lf %lf", &A, &B);
   MEDIA= ((A*3.5)+(B*7.5))/11;
   printf ("MEDIA = %.5lf\n", MEDIA);  
   return 0;
}







URI Online Judge 1004 Simple Product Solution

URI Online Judge | 1004
Simple Product
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1


Problem Description:

Problem Number:1004
Problem Name: Simple Product
Author’s Name:Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1004
Solution in C


#include <stdio.h>
int main()
{
   int A,B;
   scanf ("%d %d", &A, &B);
   printf("PROD = %d\n",A*B);  
   return 0;
}





URI Online Judge 1003 Simple Sum Solution

URI Online Judge | 1003
Simple Sum
Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1

Problem Description:

Problem Number:1003
Problem Name: Simple Sum
Author’s Name:Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source:https://www.urionlinejudge.com.br/judge/en/problems/view/1003

Solution in C

#include <stdio.h>
int main()
{
    int A, B, Sum;
    scanf("%d %d", &A, &B);
    Sum = A + B;
    printf("SOMA = %d\n", Sum);
    return 0;
}







URI Online Judge 1002 Area of a Circle Solution

URI Online Judge | 1002 
Area of a Circle 
Adapted by Neilor Tonin, URI  Brazil 
Timelimit: 1


Problem Description:

Problem Number:1002
Problem Name: Area of a Circle
Author’s Name:Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Problem Category: BEGINNER.
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1002
Solution in C


#include <stdio.h>
int main()
{
    double pi=3.14159,R,A;
    scanf("%lf",&R);
    A=pi*R*R;
    printf("A=%.4lf\n",A);
    return 0;
}






URI Online Judge 1001 Extremely Basic solution

URI Online Judge | 1001 
Extremely Basic Adapted by Neilor Tonin, URI  Brazil 
Timelimit: 1

Problem Description: 

Problem Number:1001
Problem Name: Extremely Basic
Author’s Name:Adapted by Neilor Tonin, URI  Brazil 
Timelimit: 1
Problem Category: BEGINNER. 




#include<stdio.h>
int main() 
{ 
int A,B,X; 
scanf ("%d %d", &A, &B); 
X=A+B; 
printf("X = %d\n",X); 
return 0; 
}



Friday, May 8, 2020

URI Online Judge 2172 Event


URI Online Judge | 2172
 Event 
By Nivaldo Carvalho, UNIPE BR Brazil 
Timelimit: 2



Problem Description: 

Problem Number:2172
Problem Name: Event 
Author’s Name:Nivaldo Carvalho, UNIPE BR Brazil
Timelimit: 2 
Problem Category: BEGINNER. 



#include <stdio.h>
int main()
         {   
            long long int x, m;   

            while(1)   
                    {        
                    scanf("%lld%lld", &x, &m);        
                    if(x==0 && m==0)            
                                break;        
                    printf("%lld\n", x*m);   
                      }    
                     return 0;
          }





URI Online Judge 1589 Bob Conduit solution

URI Online Judge | 1589 Bob Conduit 
By Bruno Adami, Universidade de São Paulo - São Carlos BR Brazil
 Timelimit: 1

Problem Description: 
Problem Number:1589 
Problem Name: Bob Conduit 
Author’s Name: Bruno Adami, Universidade de São Paulo - São Carlos BR Brazil
Timelimit: 1 
Problem Category: BEGINNER. 

#include <stdio.h>
int main()
{
    int T, R1, R2, x, y;
    scanf("%d", &T);
    for(x=1; x<=T; x++)
    {
        scanf("%d%d", &R1, &R2);
        y=R1+R2;
        printf("%d\n",y);
    }
    return 0;
}





URI Online Judge 1144 Logical Sequence solution


URI Online Judge | 1144 Logical Sequence
Adapted by Neilor Tonin, URI  Brazil  Timelimit:1

Problem Description: 
Problem Number:1144
Problem Name: Logical Sequence 
Author’s Name: Adapted by Neilor Tonin, URI Brazil Timelimit: 1 
Problem Category: BEGINNER.


#include <stdio.h>
int main()
{
    int a,b,c,d,e,f;
    scanf("%d", &a);
    for(b=1; b<=a; b++)
    {
        c=b*b;
        d=b*b*b;
        printf("%d %d %d\n",b,c,d);
        e=c+1;
        f=d+1;
        printf("%d %d %d\n",b,e,f);
    }
    return 0;
}






Friday, May 1, 2020

URI Online Judge 1099 Sum of Consecutive Odd Numbers II solution


URI Online Judge qus no1099 Sum of Consecutive Odd Numbers II solution


#include <stdio.h>
int main()
{
    int N,X,Y,A,b,c=0;
    scanf("%d", &N);
    for(A=1;A<=N;A++)
    {
        scanf("%d%d",&X,&Y);
        if(X==Y)
        {
            c=0;
            printf("%d\n",c);
        }
        else if(X<Y)
        {
            for(b=X+1,c=0;b<Y;b++)
            {
                if(b%2==1||b%2==-1)
                    c+=b;
            }
            printf("%d\n",c);
        }
        else
        {
            for(b=Y+1,c=0;b<X;b++)
            {
                if(b%2==1||b%2==-1)
                    c+=b;
            }
            printf("%d\n",c);
        }
    }
    return 0;
}

URI Online Judge 2176 Parity solution

URI Online Judge qus no 2176 Parity solution


#include <stdio.h>
#include <string.h>
int main()
{
    char str[150]; // str is a array
    int i, cnt=0;
    scanf("%s", str);  // for string %s
    for(i=0; str[i]; i++) 
        if(str[i]=='1')
            cnt++; //cnt increment
    if(cnt%2 == 0)
        str[i] = '0';
    else
        str[i] = '1';
    str[i+1] = '\0';
    printf("%s\n", str);
    return 0;
}

Read on-> বেডরুম সাজানোর ডেকোরেশন আইডিয়া - Bedroom Decoration


URI Online Judge 1059 Even Numbers solution





URI Online Judge program no 1059 Even Numbers solutions

#include <stdio.h>
int main()
{
    int a;
    for(a=2; a<=100; a=a+2) // a must be little by 100
        printf("%d\n",a);
    return 0;
}