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 - 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 - 1151 solution in C

#include<stdio.h>
int main(){
    int N,i,n[100];
    scanf("%d", &N);
    
    n[0] = 0;
    n[1] = 1;
    
    for(i = 2; i < N; i++){
        n[i] = n[i-1] + n[i-2];
    }
    printf("0");
    for(i = 1; i < N; i++){
        printf(" %d", n[i]);
    }
    printf("
");
    return 0;
}
Comment

BEE/URI problem no 1181 solution in C

#include<stdio.h>
int main(){
    double M[12][12],sum = 0.0;
    int i,j,L;
    char x[2];
    
    scanf("%d", &L);
    scanf("%s", x);
    for(i = 0; i < 12; i++){
        for(j = 0; j < 12; j++){
            scanf("%lf", &M[i][j]);
        }
    }
    for(i = 0; i < 12; i++){
        sum += M[L][i];
    }
    if(x[0] == 'S'){
        printf("%.1lf
", sum);
    }else if(x[0] == 'M'){
        printf("%.1lf
", sum/12.0);
    }
    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

Uri/Beecrowd Problem no - 1185 Solution in Java

import java.util.Scanner;
public class Main{
    public static void main (String[] args) {
        Scanner obj = new Scanner(System.in);
        double M[][] = new double[12][12];
        double sum = 0.0;
        int i,j,counter = 1;
        String O = obj.next();
        
        for(i = 0; i < 12; i++){
            for(j = 0; j < 12; j++){
                M[i][j] = obj.nextDouble();
            }
        }
        for(i = 10; i >= 0; i--){
            for(j = 0; j < counter; j++){
                sum += M[i][j];
            }
            counter++;
        }
        if(O.equals("S")){
            System.out.printf("%.1f
", sum);
        }else if(O.equals("M")){
            System.out.printf("%.1f
", sum/66.0);
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
C :: c pointers to struct 
C :: how to make an integer value equal to character 
C :: Macro definition and expansion 
C :: visa germany algeria 
C :: 25802 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of D:Devtoolsminicondalibsite-packages ensorflowpythonclient\_pywrap_tf_session.pyd 
C :: pdo crud 
C :: convert c code to c online 
C :: C (K&R) 
C :: data breach 
C :: increment c 
C :: c language dictionary implemet 
C :: taking input and converting it to a string in c 
C :: c refresher 
C :: Wait until an animation finishes - Selenium, Java 
C :: how to make play a song javascript 
C :: inline function in c example 
C :: c logarithm check if number is base 
C :: Write a c program to add two numbers without using addition operator. 
C :: c if statement 
C :: arrays c 
Dart :: flutter appbar backbutton remove 
Dart :: dart string remove first character 
Dart :: flutter border around textbutton 
Dart :: showdialog with builder flutter 
Dart :: detect os in flutter 
Dart :: close current page flutter 
Dart :: Floating Action Button rectangular shaped (round corners) 
Dart :: generate method o dart list 
Dart :: dart convert int string leading zeros 
Dart :: flutter container height 100 percent 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =