package com.chongrui.test;
/*
while用法一例
* */
//import java.util.Scanner;
public class TypeConvertion {
public static void main(String[] args){
//public static void main(String args){
int x =1;
int sum = 0;
while(x<=10){
sum = sum + x;
x++;
}
System.out.println("1到10的和是sum:="+sum);
}
}
1到10的和是sum:=55