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 - 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 :: c "hello world" 
C :: gnunet 
C :: c program boilerplate code 
C :: which one is faster loop or recursive function? 
C :: when to add & in snacf c 
C :: Trier lexicographiquement en c 
C :: c program for airthmetic operators 
C :: arcpy buffer 
C :: logarithmus c math.h 
C :: c michael 
C :: changing data type in one line c program 
C :: using tables as arguments in c++/c 
C :: Wait until an animation finishes - Selenium, Java 
C :: how to turn off bash 
C :: C static libraries (creating archive from object files) 
C :: snprintf with malloc 
C :: function pointer in c 
C :: array of string in c 
C :: how to find the elements in array c coding 
C :: latex font sizes 
Dart :: textfield border radius flutter 
Dart :: flutter lock screen to portrait mode 
Dart :: Keyboard Pushes Text Fields off screen flutter 
Dart :: how to print in the same line in dart 
Dart :: dart create id 
Dart :: remove menu icon from appbar flutter 
Dart :: iran phone number regex 
Dart :: clickable card flutter 
Dart :: flutter flotingactionbutton extend 
Dart :: dart list remove range 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =