首页 > 其他分享 >Struct ForDemo04

Struct ForDemo04

时间:2023-10-22 13:02:06浏览次数:29  
标签:ForDemo04 Struct int System public out

package com.chen.struct;

public class ForDemo04 {
public static void main(String[] args) {
//打印九九乘法表
//1.先打印第一列
//2.把固定的1在用一个循环包起来
//3.去掉重复项,i = j;
//调整样式
for (int i = 1; i <= 9; i++) {
for (int j = 1; j <= i; j++) {
System.out.print(i + "*" + j + "=" + (i * j) + "\t");
}
System.out.println();
}
}
}

标签:ForDemo04,Struct,int,System,public,out
From: https://www.cnblogs.com/jingyichenloveningning/p/17780301.html

相关文章

  • Codeforces Round 865 (Div. 2) B. Grid Reconstruction
    给一个\(2\timesn\)的网格,且\(n\)是偶数。你需要将\(1\sim2\timesn\)填入这个网格。一条路径是从\((1,1)\)开始,每次只能向右或向下,到\((2,n)\)结束时,所经过的位置。按经过点的顺序标号,一两条路径的代价是\(cost=a_1-a_2+a_3-a_4+\cdots=\sum_{i=1......
  • CF1003E Tree Constructing
    很trivial的构造题首先上来判掉一些显然无解的情况,然后考虑既然最后直径长为\(d\)那么不妨先搞一条长度为\(d\)的链来考虑在链上接一些点使得直径不会变长,对于链上的某个点,它最多能接上的链的长度就是它到两个端点距离的最小值不妨设计递归函数求解,设solve(x,dis,lim)表示在\(x......
  • Struct IfDemo02
    packagecom.chen.struct;importjava.util.Scanner;publicclassIfDemo02{publicstaticvoidmain(String[]args){//考试分数大于60分就是及格,小于60分就是不及格。Scannerscanner=newScanner(System.in);System.out.println("请输入成......
  • Struct SwitchDemo01
    packagecom.chen.struct;importjava.util.Scanner;publicclassSwitchDemo01{publicstaticvoidmain(String[]args){//case穿透//switch匹配一个具体的值chargrade='C';switch(grade){case'A':......
  • Struct SequenceDemo01
    packagecom.chen.struct;publicclassSequenceDemo01{publicstaticvoidmain(String[]args){System.out.println("hello1");System.out.println("hello2");System.out.println("hello3");System.o......
  • Struct IfDemo03
    packagecom.chen.struct;importjava.util.Scanner;publicclassIfDemo03{publicstaticvoidmain(String[]args){//考试分数大于60分就是及格,小于60分就是不及格。Scannerscanner=newScanner(System.in);System.out.println("请输入成......
  • Struct SwitchDemo02
    packagecom.chen.struct;publicclassSwitchDemo02{publicstaticvoidmain(String[]args){Stringname="种崎敦美";//JDK7的新特性,表达式结果可以是字符串!!!//字符的本质还是数字//反编译Java----class(字节码文件)-----反编译(ID......
  • Struct WhileDemo03
    packagecom.chen.struct;publicclassWhileDemo03{publicstaticvoidmain(String[]args){//计算1+2+3...+100=?//高斯的故事inti=0;intsum=0;while(i<=100){sum=sum+i;i++;}......
  • Struct DoWhileDemo02
    packagecom.chen.struct;publicclassDoWhileDemo02{publicstaticvoidmain(String[]args){inta=0;while(a<0){System.out.println(a);a++;}System.out.println("==============");......
  • Struct DoWhileDemo01
    packagecom.chen.struct;publicclassDoWhileDemo01{publicstaticvoidmain(String[]args){inti=0;intsum=0;do{sum=sum+i;i++;}while(i<=100);System.out.println(sum);}}......