040.程序流程结构-跳转语句-goto语句

2021/9/4 11:07:54

本文主要是介绍040.程序流程结构-跳转语句-goto语句,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

#include <iostream>
using namespace std;
int main()
{
    //goto语句

    cout << "1.xxxxxxxxxx" << endl;
    cout << "2.xxxxxxxxxx" << endl;
    goto AA;//跳转到标记
    cout << "3.xxxxxxxxxx" << endl;
    cout << "4.xxxxxxxxxx" << endl;
AA://标记,后面使用冒号
    cout << "5.xxxxxxxxxx" << endl;

    system("pause");
    return 0;
}

 



这篇关于040.程序流程结构-跳转语句-goto语句的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程