1 solutions

  • 0
    @ 2023-10-31 16:30:44

    转载自Luogu的一位巨佬。

    那么开始我们的正题:

    题目分析

    相信许多人都会一行一行复制内容进入代码然后再提交上去,这种感觉是非常痛苦滴~

    所以我们今天将要介绍一种非常牛(鬼)逼(畜)的方法。

    那么,我们编写一个程序,让它自动输出我们控制输出的代码。

    废话不说,上代码:

    # include<iostream>
    # include<cstdlib>
    # include<string>
    using namespace std;
    int main(){
    	string s[25];//保存将要输出的内容,空间开大一点没有坏处
    	for(int i=0;i<22;++i) getline(cin,s[i]);//读入我们将要输出的内容
    	system("cls");//清屏,头文件<cstdlib>
    	for(int i=0;i<22;++i) cout<<"cout<<\""<<s[i]<<"\"<<endl;"<<endl;//我们的重头戏,输出代码
    	for(;;);//加不加无所谓
    	return 0;
    }
    

    这是程序的运行结果:

    cout<<"                ********"<<endl;
    cout<<"               ************"<<endl;
    cout<<"               ####....#."<<endl;
    cout<<"             #..###.....##...."<<endl;
    cout<<"             ###.......######              ###            ###"<<endl;
    cout<<"                ...........               #...#          #...#"<<endl;
    cout<<"               ##*#######                 #.#.#          #.#.#"<<endl;
    cout<<"            ####*******######             #.#.#          #.#.#"<<endl;
    cout<<"           ...#***.****.*###....          #...#          #...#"<<endl;
    cout<<"           ....**********##.....           ###            ###"<<endl;
    cout<<"           ....****    *****...."<<endl;
    cout<<"             ####        ####"<<endl;
    cout<<"           ######        ######"<<endl;
    cout<<"##############################################################"<<endl;
    cout<<"#...#......#.##...#......#.##...#......#.##------------------#"<<endl;
    cout<<"###########################################------------------#"<<endl;
    cout<<"#..#....#....##..#....#....##..#....#....#####################"<<endl;
    cout<<"##########################################    #----------#"<<endl;
    cout<<"#.....#......##.....#......##.....#......#    #----------#"<<endl;
    cout<<"##########################################    #----------#"<<endl;
    cout<<"#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#"<<endl;
    cout<<"##########################################    ############"<<endl;
    

    最终代码

    接下来,我们把上面的的代码直接Ctrl+C进去就刑啦!

    # include<iostream>
    # include<cstdio>
    using namespace std;
    int main(){
    	cout<<"                ********"<<endl;
    	cout<<"               ************"<<endl;
    	cout<<"               ####....#."<<endl;
    	cout<<"             #..###.....##...."<<endl;
    	cout<<"             ###.......######              ###            ###"<<endl;
    	cout<<"                ...........               #...#          #...#"<<endl;
    	cout<<"               ##*#######                 #.#.#          #.#.#"<<endl;
    	cout<<"            ####*******######             #.#.#          #.#.#"<<endl;
    	cout<<"           ...#***.****.*###....          #...#          #...#"<<endl;
    	cout<<"           ....**********##.....           ###            ###"<<endl;
    	cout<<"           ....****    *****...."<<endl;
    	cout<<"             ####        ####"<<endl;
    	cout<<"           ######        ######"<<endl;
    	cout<<"##############################################################"<<endl;
    	cout<<"#...#......#.##...#......#.##...#......#.##------------------#"<<endl;
    	cout<<"###########################################------------------#"<<endl;
    	cout<<"#..#....#....##..#....#....##..#....#....#####################"<<endl;
    	cout<<"##########################################    #----------#"<<endl;
    	cout<<"#.....#......##.....#......##.....#......#    #----------#"<<endl;
    	cout<<"##########################################    #----------#"<<endl;
    	cout<<"#.#..#....#..##.#..#....#..##.#..#....#..#    #----------#"<<endl;
    	cout<<"##########################################    ############"<<endl;
    	return 0;
    }
    

    注意事项

    谁复制谁是狗!

    • 1

    Information

    ID
    2440
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    1
    Tags
    # Submissions
    18
    Accepted
    10
    Uploaded By