zoukankan      html  css  js  c++  java
  • 认识认识break and continue。。。回顾大一

    《1》先来break——1看图,看代码,你懂的

     1 # include<iostream>
     2 # include<cstdio>
     3 using namespace std;
     4 int main()
     5 {
     6     for(int i = 0; i < 100; i++)
     7     {
     8         printf("%d
    ",i);
     9         if(i == 10)
    10         {
    11             break;
    12             //continue;
    13         }
    14 
    15     }
    16     printf("hello world
    ");
    17     return 0;
    18 }
    View Code

    《2》再来看break——2看图,看代码

     1 # include<iostream>
     2 # include<cstdio>
     3 using namespace std;
     4 int main()
     5 {
     6     for(int i = 0; i < 100; i++)
     7     {
     8 
     9         if(i == 10)
    10         {
    11             break;
    12             //continue;
    13         }
    14         printf("%d
    ",i);
    15 
    16     }
    17     printf("hello world
    ");
    18     return 0;
    19 }
    View Code

    《3》再来看continue。。看图,看代码

     1 # include<iostream>
     2 # include<cstdio>
     3 using namespace std;
     4 int main()
     5 {
     6     for(int i = 0; i < 100; i++)
     7     {
     8 
     9         if(i == 10)
    10         {
    11             //break;
    12             continue;
    13         }
    14         printf("%d
    ",i);
    15 
    16     }
    17     printf("hello world
    ");
    18     return 0;
    19 }
    View Code

    纪念我失去的青春和女友。。。我爱你们。。。

  • 相关阅读:
    TCGA下载神器--TCGAbiolinks
    perl模块终极解决方案--转载
    Web前端优化
    关于CDN
    手写RateLimiter
    互联网高并发之限流
    互联网高并发之Hystrix实现服务隔离和降级
    关于Hystrix
    Apollo原理
    SpringBoot2.0之整合Apollo
  • 原文地址:https://www.cnblogs.com/sxmcACM/p/3384112.html
Copyright © 2011-2022 走看看