Initial commit
Works perfectly.
This commit is contained in:
commit
4f1475dfa8
10 changed files with 77 additions and 0 deletions
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
1
.idea/description.html
Normal file
1
.idea/description.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<html>Simple <b>Java</b> application that includes a class with <code>main()</code> method</html>
|
6
.idea/encodings.xml
Normal file
6
.idea/encodings.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
12
.idea/misc.xml
Normal file
12
.idea/misc.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EntryPointsManager">
|
||||||
|
<entry_points version="2.0" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectKey">
|
||||||
|
<option name="state" value="project://e2804f05-5315-4fc6-a121-c522a6c26470" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_16" default="true" project-jdk-name="16" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/FizzBuzz.iml" filepath="$PROJECT_DIR$/FizzBuzz.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
3
.idea/project-template.xml
Normal file
3
.idea/project-template.xml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<template>
|
||||||
|
<input-field default="com.company">IJ_BASE_PACKAGE</input-field>
|
||||||
|
</template>
|
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
11
FizzBuzz.iml
Normal file
11
FizzBuzz.iml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
BIN
out/production/FizzBuzz/com/company/Main.class
Normal file
BIN
out/production/FizzBuzz/com/company/Main.class
Normal file
Binary file not shown.
27
src/com/company/Main.java
Normal file
27
src/com/company/Main.java
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
package com.company;
|
||||||
|
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner scan = new Scanner(System.in);
|
||||||
|
System.out.println("Input the number to stop at:");
|
||||||
|
int stop = scan.nextInt();
|
||||||
|
for (int i = 1; i <= stop; i++){
|
||||||
|
boolean flag = true;
|
||||||
|
if (i % 3 == 0){
|
||||||
|
System.out.print("Fizz");
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (i % 5 == 0){
|
||||||
|
System.out.print("Buzz");
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
if (flag){
|
||||||
|
System.out.print(i);
|
||||||
|
}
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue