Search
 
SCRIPT & CODE EXAMPLE
 

C

Uri/beecrowd problem no - 1099 solution in C

#include<stdio.h>
int main(){
    int N,X,Y,i,j,sum = 0;
    scanf("%d", &N);
    
    for(i = 1; i <= N; i++){
        scanf("%d%d", &X, &Y);
        if(X > Y){
            for(j = Y+1,sum = 0; j < X; j++){
                if(j % 2 != 0){
                    sum += j;
                }
            }
        }else if(X <= Y){
            for(j = X+1,sum = 0; j < Y; j++){
                if(j % 2 != 0){
                    sum += j;
                }
            }
        }
        printf("%d
", sum);
    }
    return 0;
}
Comment

Uri/beecrowd problem no - 1131 solution in C

#include<stdio.h>
int main(){
    int limit = 1,counter = 0,counter1 = 0,counter2 = 0,counter3 = 0;
    while(limit != 2){
        if(limit == 1){
            int score1,score2;
            scanf("%d%d", &score1, &score2);
            if(score1 > score2){
                counter1++;
            }else{
                counter2++;
            }
            if(score1 == score2){
                counter3++;
            }
        }
        printf("Novo grenal (1-sim 2-nao)
");
        counter++;
        scanf("%d", &limit);
    }
    printf("%d grenais
", counter);
    printf("Inter:%d
", counter1);
    printf("Gremio:%d
", counter2);
    printf("Empates:%d
", counter3);
    if(counter1 > counter2){
        printf("Inter venceu mais
");
    }
    if(counter1 < counter2){
        printf("Gremio venceu mais
");
    }
    if(counter2 == counter1){
        printf("Não houve vencedor
");
    }
    return 0;
}
Comment

uri/beecrowd problem no - 1133 solution in C

#include<stdio.h>
int main(){
    int X,Y,i;
    
    scanf("%d%d", &X, &Y);
    
    if(X > Y){
        for(i = Y+1; i < X; i++){
            if(i % 5 == 2 || i % 5 == 3){
                printf("%d
", i);
            }
        }
    }else if(X < Y){
        for(i = X+1; i < Y; i++){
            if(i % 5 == 2 || i % 5 == 3){
                printf("%d
", i);
            }
        }
    }
    return 0;
}
Comment

Uri/Beecrowd problem no - 1146 solution in Java

import java.util.Scanner;
public class Main{
    public static void main (String[] args) {
        Scanner obj = new Scanner(System.in);
        int X;
        while(true){
            X = obj.nextInt();
            if(X == 0){
                break;
            }else{
                System.out.print("1");
                for(int i = 2; i <= X; i++){
                    System.out.print(" " + i);
                }
                System.out.println();
            }
        }
    }
}
Comment

Uri/Beecrowd problem no - 1149 solution in C

#include<stdio.h>
int main(){
    int A,N,sum = 0,i;
    scanf("%d%d", &A, &N);
    while(N < 0 || N == 0){
        scanf("%d", &N);
    }
    for(i = 0; i < N; i++){
        sum = sum + A + i;
    }
    printf("%d
", sum);
    return 0;
}
Comment

Uri/Beecrowd Problem no - 1184 solution in C

#include<stdio.h>
int main(){
    double M[12][12],sum = 0;
    int i,j,counter = 1;
    char O[2];
    scanf("%s", O);
    
    for(i = 0; i < 12; i++){
        for(j = 0; j < 12; j++){
            scanf("%lf", &M[i][j]);
        }
    }
    for(i = counter; i < 12; i++){
        for(j = 0; j < counter; j++){
            sum += M[i][j];
        }
        counter++;
    }
    if(O[0] == 'S'){
        printf("%.1lf
", sum);
    }else if(O[0] == 'M'){
        printf("%.1lf
", sum / 66.0);
    }
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: profile time bash script 
C :: C program to Increase 1 to all of the given Integer Digit 
C :: unity read text file line by line 
C :: unconstrained box flutter 
C :: fread condition 
C :: /usr/bin/mandb: fopen /var/cache/man/7935: Permission denied 
C :: what to do after gan training 
C :: The closest in between 
C :: navigate to line intellij 
C :: countoddevenDifference 
C :: c printf float value 
C :: C Syntax of function prototype 
C :: c Write a program to reverse an array or string 
C :: printf n characters c 
C :: visual studio code 
Dart :: flutter wait for specific time 
Dart :: python change type of elements in list 
Dart :: flutter border around textbutton 
Dart :: flutter text color 
Dart :: undeline to text in flutter 
Dart :: flutter launcher icon generate 
Dart :: drawer corner radius flutter 
Dart :: Flutter turn string to int 
Dart :: flutter reverse list 
Dart :: how to disable windows build flutter 
Dart :: six_ft_apart_rounded 
Dart :: Get current timestamp in flutter or dart 
Dart :: alert dialog flutter 
Dart :: dart loop through list 
Dart :: dart hello world 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =