10

mail@pastecode.io avatar
unknown
java
13 days ago
1.6 kB
0
Indexable
Never
import java.util.Scanner;

public class Task10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int taka = sc.nextInt();
        int note_500 = 0;
        int note_100 = 0;
        int note_50 = 0;
        int note_10 = 0;
        int note_5 = 0;
        int note_1 = 0;
        int remaining = 0;

        for (int i = 500; i <= taka; i += 500) {
            note_500++;
            remaining = taka - i;
        }

        taka = remaining;
        remaining = 0;

        for (int i = 100; i <= taka; i += 100) {
            note_100++;
            remaining = taka - i;
        }

        taka = remaining;
        remaining = 0;

//        for (int i = 50; i <= taka; i += 50) {
//            note_50++;
//            remaining = taka - i;
//        }

//        taka = remaining;
//        remaining = 0;

        for (int i = 10; i <= taka; i += 10) {
            note_10++;
            remaining = taka - i;
        }


        taka = remaining;
        remaining = 0;

//        for (int i = 5; i <= taka; i += 5 ) {
//            note_5++;
//            remaining = taka - i;
//        }
//
//        taka = remaining;
//        remaining = 0;

        for (int i = 1; i <= taka; i+= 1) {
            note_1++;
            remaining = taka - i;
        }




        System.out.println(note_500 + " 500's note");
        System.out.println(note_100 + " 100's note");

        System.out.println(note_10 + " 10's note");

        System.out.println(note_1 + " 1's note");






    }
}
Leave a Comment