- 久々にpythonを打ってみると、意外と覚えてないことに焦りました。こまめにコードを打つことの大切さが分かりました。
- 今までは答えさえあってればいいという考えだったが、これからは処理速度や、見やすさなども考えていかなければならないということを学びました。
- リスト内包等、今までやったことのない記述方法が難しかったです。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| import java.util.stream.*; | |
| class testEvenOdd { | |
| public static void main(String[] args) { | |
| int[] nums1 = {1,0,1,0,0,1,1}; | |
| int[] nums2 = {3,3,2}; | |
| int[] nums3 = {3,2,2}; | |
| evenOdd(nums1); | |
| evenOdd(nums2); | |
| evenOdd(nums3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.stream.*; | |
| class testFizzArray { | |
| public static void main(String[] args) { | |
| fizzArray3(5,10); | |
| } | |
| public static int[] fizzArray3(int start, int end) { | |
| return IntStream | |
| .range(start, end - 1) | |
| .toArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class testMoneyBox { | |
| public static void main(String[] args) { | |
| MoneyBox moneyBox = new MoneyBox(); | |
| moneyBox.run(); | |
| moneyBox.show(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class testToOrdinal { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| String n; | |
| System.out.println("0以上の整数を入力: "); | |
| n = sc.next(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class testTriangleCheck { | |
| public static void main(String[] args) { | |
| Scanner sc = new Scanner(System.in); | |
| TriangleCheck trianglecheck = new TriangleCheck(); | |
| System.out.print("辺aの長さを入力"); | |
| trianglecheck.add(sc.nextInt()); | |
| System.out.print("辺bの長さを入力"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.*; | |
| class testScoreAverage { | |
| public static void main(String[] args) { | |
| ScoreAverage scoreAverage = new ScoreAverage(); | |
| Scanner sc = new Scanner(System.in); | |
| int n; | |
| while (true) { | |
| System.out.print("値を入力してください: "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a, d, p = input().split() | |
| a = int(a) | |
| d = int(d) | |
| if p == "+": | |
| print(a + d) | |
| else: | |
| print(a - d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [n,m] = [int(col) for col in input().split()] | |
| [print('OK') if (m % n == 0) else print('NG')] |
NewerOlder