Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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 - 1150 solution in Java

import java.util.Scanner;

public class Main{
    public static void main (String[] args) {
        Scanner obj = new Scanner(System.in);
        int X,Z,counter = 1,c = 0,i;
        X = obj.nextInt();
        Z = obj.nextInt();
        
        while(Z <= X){
            Z = obj.nextInt();
            for (i = X; i <= Z; i++){
                c += i;
                if(c > Z){
                    break;
                }else{
                    counter++;
                }
            }
        }
        System.out.println(counter);
    }
}
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
Java :: hippo get a node via id 
Java :: java coding standards for interfaces 
Java :: autorest generate java client 
Java :: grepper editor 
Java :: MojoExecutionException when generate sources cxf-xjc-plugin:3.3.0 java11 
Java :: how to secure specific url in spring security 
Java :: java producer consumer queue 
Java :: .int x=5; final int y=7; x=x+10; y=y+10; 
Java :: discount computation in java 
Java :: make for on all variable in class in java 
Java :: Java continue with Nested Loop 
Java :: mock ioexception mockito on BufferedReader 
Java :: Array first Occurence 
Java :: dequeue element to queue java 
Java :: Join Two Java Strings 
Java :: How to center a print statement text? 
Java :: how to enable/disable wifi or internet 
Java :: reading txt file javafx 
Java :: darkhub 
Java :: jersey get session time 
Java :: httpsession vs cookie servlet 
Java :: 2 multiples recursion 
Java :: how to sort a interable in java 
Java :: recursive in java 
Java :: how to write 1,2,3,4.... in java 
Java :: javax big int validation in spring boot 
Java :: what is this code (long millis=System.currentTimeMillis(); java.sql.Date date=new java.sql.Date(millis); 
Java :: Composite primary key jpa 
Java :: how to insert a char at n position java 
Java :: lighting strike solved 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =