1 /*
 2    Name:1-100所有奇数求和的程序
 3    Power by  Stuart
 4    Date:2015-4-23
 5 */
 6 
 7 
 8 public class DateTest01{
 9     
10     public static void main(String args[]){
11         //for循环,每次循环间隔2次
12         for(int i=1;i<=100;i+=2){
13             t+=i;//t=i+1;
14         }
15         System.out.println("从1到100的奇数为"+t);
16     }
17      
18 }

 

相关文章:

  • 2022-12-23
  • 2021-04-21
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2019-12-04
  • 2021-12-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案