spimB-2

.datastr1: .asciiz "Enter int-number:"ans1: .asciiz "square:"ans2: .asciiz "square root:"Unsuitable_text: .asciiz "! The square root of a negative number does not exist !"eol: .asciiz "\n".text.globl main main:li $v0, 4la $a0, str1syscall …

spimB-1

.dataopen_bracket: .asciiz "["close_bracket: .asciiz "] = "str1: .asciiz "Enter int-number:"str2: .asciiz "Print"str3: .asciiz "Enter Array size:"error: .asciiz "!negative number has entered!"eol: .asciiz "\n".text.globl main main:jal Ente…

.databuffer: .space 64str1: .asciiz "Enter int-number:"str2: .asciiz "Enter float-number:"str3: .asciiz "Enter double-number:"str4: .asciiz "Enter String:"str5: .asciiz "Enter char:"ans1: .asciiz "this number is =>"ans2: .asciiz "this stri…

spim

.databuffer: .space 64str1: .asciiz "Enter int-number:"str2: .asciiz "Enter float-number:"str3: .asciiz "Enter double-number:"str4: .asciiz "Enter String:"str5: .asciiz "Enter char:"ans1: .asciiz "this number is =>"ans2: .asciiz "this stri…

a

import java.util.*;import java.io.*; public class WUGraph { int numOfNodes; ArrayList<Edge> list = new ArrayList<Edge>(); //隣接ノード、重さ// class Edge implements Comparable<Edge> { private int to; // 辺番号// private int weight; //重さ// private int node</edge></edge></edge>…

kadai2

import java.util.*; class Dijkstra extends Graph{ int slowDijkstra(int start) { double D = new double[nodes.size()]; //頂点ごとへの最短距離// int Search = new int [nodes.size()]; int tree = new int [nodes.size()]; int remain = nodes.size()…

kadai1

import java.util.*;import java.io.*; public class Graph { int num = 0; ArrayList<Edge> list = new ArrayList<Edge>(); //隣接ノード、重さ// ArrayList<Node> nodes = new ArrayList<Node>(); //ノード番号、隣接数、先頭オフセット// class Edge { private int to; private do</node></node></edge></edge>…

import java.util.*;class BFS extends Graph { Queue<Integer> s = new LinkedList<Integer>(); int BFSTree(int root) { int Search = new int [nodes.size()]; int tree = new int [nodes.size()]; s.offer(root); for (int i = 0; i < nodes.size(); i++) { Search[i] = 1;</integer></integer>…

import java.util.*;import java.io.*; public class Graph { int num = 0; ArrayList<Edge> list = new ArrayList<Edge>(); //隣接ノード// ArrayList<Node> nodes = new ArrayList<Node>(); //ノード番号、隣接数、先頭オフセット// class Edge { private int to; Edge(int to) {th</node></node></edge></edge>…

kp

public class Solver { int n, capacity, answer; int weight, value; int D; public Solver(int n, int weight, int value, int capacity) { this.n = n; this.weight = weight; this.value = value; this.capacity = capacity; } int solve(){ int D = new…

fibo

class FiboRec { public int FibR(int n) { if (n <= 2) return 1; else return FibR(n - 1) + FibR(n - 2); } } class FiboDP { public int FibD(int m) { int F = new int[m]; F[0] = F[1] = 1; for (int i = 2; i < m ; i++) F[i] = F[i-1] + F[i-2]; ret…

import java.util.*; public class SignalSimulator { public static void main (String[] args) { if (args.length != 3) { System.out.println("使用方法: java SignalSimulator 車列への追加周期 車列の上限 信号の周期"); System.out.println("使用例 …

import java.io.*; public class FindFile { public static void searchDir(String a,String b) { File A = new File(a); String files = A.list(); if ( A.list() == null){ if (a.indexOf(b) != -1) System.out.println(A.getAbsolutePath()); } else for …

import java.io.*; public class FindFile1 { public static void main (String args) { if (args.length != 2) { System.out.println("使用例:java FindFile1 検索文字列 検索対象ファイル"); System.out.println("例:java FindFile1 System FindFile1.ja…

13-3

public class ExceptionTest5 { public static void main(String[] args) { try { method1(0); method2(0); method3(0); } catch (Exception e) { System.out.println("例外:" + e ); } } static void method1(int x) throws Exception { } static void met…

13-1

public class ExceptionTest3 { public static void main(String args) { int myarray = new int[3]; myAssign(myarray,100,0); System.out.println("終了します"); } static void myAssign(int[] arr, int index, int value) { System.out.println("myAssig…

class VariableBaseValue{ // フィールド // private static int base = 10; private int value = 2; VariableBaseValue(int v) {this.value = v;} void setBase(int b) { if (base > 10) b = 10; if (base < 2) b = 2; base = b;} void setValue(int v) {if…

10-3

public final class MinMax { // 2値の最大値 // public static double maxOf2(double a, double b) { double max = a; if (b > max) max = b; return max; } // 3値の最大値 // public static double maxOf3(double a, double b, double c) { double max = …

11-1

package id; import java.util.GregorianCalendar;import static java.util.GregorianCalendar.*; public class DateId { private static int counter; // 何番までの識別番号を与えたか private int id; // 識別番号 static { GregorianCalendar today = ne…

10-4

// 日付クラスDay【第4版】import java.util.GregorianCalendar;import static java.util.GregorianCalendar.*;import java.util.Scanner; public class Day { GregorianCalendar today = new GregorianCalendar(); int year = today.get(YEAR); // 年 int …

2nd challenge

class VariableBaseValue{ // フィールド // private static int base = 10; private int value = 2; public VariableBaseValue() { } public VariableBaseValue(int base) { this.base = base;} public VariableBaseValue(int base, int value) { this(base…

void add(Complex comp){ double nx=n+comp.n; double mx=m+comp.m; if(mx==0) System.out.println(nx); if(nx==0) System.out.println(mx+"i"); if(mx<0)System.out.println(nx+"-"+(-mx)+"i"); System.out.println(nx+"+"+mx+"i"); } void sub(Complex com…

import java.util.Scanner; class JAVA7182 { public static void main(String args) { Scanner stdIn = new Scanner(System.in); System.out.println("車のデータを入力せよ。"); System.out.print("名前は:"); String name = stdIn.next(); System.out.pr…

import java.util.Scanner; class JAVA51613{ public static void main(String args) { Scanner stdIn = new Scanner(System.in); System.out.print("要素数:"); int n = stdIn.nextInt(); int a = new int[n]; int b = new int[n]; for (int i = 0; i < n; …

import java.util.Scanner; class JAVA4154{ public static void main(String args) { Scanner stdIn = new Scanner(System.in); System.out.println("整数値xとyとzの合計と平均を求めます。"); System.out.print("xの値:"); int x = stdIn.nextInt(); Syst…

Celesteela @ Leftovers Ability: Beast Boost Level: 50 EVs: 196 HP / 148 Atk / 28 Def / 28 SpD / 108 Spe Adamant Nature - Heavy Slam - Leech Seed - Substitute - Protect Politoed @ Sitrus Berry Ability: Drizzle Level: 50 EVs: 252 HP / 108 De…