编程语言
首页 > 编程语言> > c++愚公移山免费代码

c++愚公移山免费代码

作者:互联网

看看免费的

#include <iostream> #include <stdlib.h> #include <unistd.h> #include <bits/stdc++.h> #include <stdio.h> //定义输入/输出函数 #include <stdlib.h> //定义杂项函数及内存分配函数 #include <string.h> //字符串处理 #include <time.h> //定义关于时间的函数 #include <wchar.h> //宽字符处理及输入/输出 #include <wctype.h> //宽字符分类 #include <algorithm> //STL 通用算法 #include <bitset> //STL 位集容器 #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> //复数类 #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> //STL 双端队列容器 #include <exception> //异常处理类 #include <fstream> #include <functional> //STL 定义运算函数 #include <limits> #include <list> //STL 线性列表容器 #include <map> //STL 映射容器 #include <iomanip> #include <ios> //基本输入/输出支持 #include <iosfwd> //输入输出系统前置声明 #include <iostream> #include <istream> //基本输入流 #include <ostream> //基本输出流 #include <cwchar> #include <cwctype> #include<windows.h> /*system("cls");清屏代码 using namespace std; void cc(const string a) { size_t len = a.size(); for(int i = 0; i < a.size(); i++) { cout << a[i]; usleep(32000); } cout<<"\n"; } rand()%4 */ using namespace std; int main(){ int a,b,c; int sxl=100/*山血量*/,djz=0/*山数量*/,rs=10,qs=100,ls=50; cout<<" @@ #######################"<<endl; cout<<" @@@@# #"<<endl; cout<<" \ # 愚公移山 #"<<endl; cout<<" \# #"<<endl; cout<<" #######################"<<endl; cout<<"有存档么? 1,输入1为有 2,输入其他为没有"<<endl; cin>>b; if(b==1){ system("cls"); cout<<"请输入存档:"; cin>>b; if(b==704588){ system("cls"); cout<<"第2号"; cin>>sxl; cin>>djz; cin>>rs; cin>>qs; cin>>ls; } } while(1){ system("cls"); if(sxl<=0){ djz=djz+1; sxl=100*djz; } cout<<"山还有"<<sxl<<"点血"<<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<<"你有"<<rs<<"人 "<<"有"<<qs<<"元 "<<"移了"<<djz<<"座山 有"<<ls<<"吨粮食"<<endl; cout<<"1,种地 2,拿钱招人 3,移山 4,存档 5,打工 "<<endl; cin>>a; if(a==1){ if(rs>=3){ rs=rs-3; ls=ls+5; } } if(a==2){ system("cls"); cout<<"招几个,一人10元"; cin>>c; if(qs>=c*10){ qs=qs-c*10; rs=rs+c; } else{ cout<<"钱不够"; cin>>c; } } if(a==3){ if(ls>=rs){ sxl=sxl-rs; ls=ls-rs; } else{ cout<<"粮食不够"; cin>>c; } } if(a==4){ system("cls"); cout<<"密码是704588"<<endl; cout<<"然后分别输出"<<sxl<<","<<djz<<","<<rs<<","<<qs<<","<<ls; cin>>c; } if(a==5){ qs=qs+djz+2; } } return 0; }

更好玩的黑暗欺骗恐怖游戏c++免费代码

0000000000000000000000000000000000000000000000000000000000000000000000000000000

#include <iostream>
#include <stdlib.h>
#include <unistd.h>
#include <bits/stdc++.h>
#include <stdio.h>     //定义输入/输出函数
#include <stdlib.h>    //定义杂项函数及内存分配函数
#include <string.h>    //字符串处理
#include <time.h>     //定义关于时间的函数
#include <wchar.h>     //宽字符处理及输入/输出
#include <wctype.h>    //宽字符分类
#include <algorithm>    //STL 通用算法
#include <bitset>     //STL 位集容器
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>     //复数类
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>      //STL 双端队列容器
#include <exception>    //异常处理类
#include <fstream>
#include <functional>   //STL 定义运算函数
#include <limits>
#include <list>      //STL 线性列表容器
#include <map>       //STL 映射容器
#include <iomanip>
#include <ios>       //基本输入/输出支持
#include <iosfwd>     //输入输出系统前置声明
#include <iostream>
#include <istream>     //基本输入流
#include <ostream>     //基本输出流
#include <cwchar>
#include <cwctype>
#include<windows.h>
/*system("cls");清屏代码
using namespace std;
void cc(const string a)
{
    size_t len = a.size();
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i];
        usleep(32000);

    }
    cout<<"\n";
}
rand()%4
*/
using namespace std;
int main(){
    int a,b,c;
    int sxl=100/*山血量*/,djz=0/*山数量*/,rs=10,qs=100,ls=50;
    cout<<"            @@ #######################"<<endl; 
    cout<<"           @@@@#                     #"<<endl; 
    cout<<"             \ #       愚公移山      #"<<endl; 
    cout<<"              \#                     #"<<endl; 
    cout<<"               #######################"<<endl; 
    cout<<"有存档么?  1,输入1为有   2,输入其他为没有"<<endl; 
    cin>>b;
    if(b==1){
        system("cls");
        cout<<"请输入存档:";
        cin>>b;
        if(b==704588){
            system("cls");
            cout<<"第2号";
            cin>>sxl;
            cin>>djz;
            cin>>rs;
            cin>>qs;
            cin>>ls;
        }
    }
    while(1){
        system("cls");
        if(sxl<=0){
            djz=djz+1;
            sxl=100*djz;
        }
        cout<<"山还有"<<sxl<<"点血"<<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<<"你有"<<rs<<"人  "<<"有"<<qs<<"元  "<<"移了"<<djz<<"座山   有"<<ls<<"吨粮食"<<endl;
        cout<<"1,种地   2,拿钱招人  3,移山  4,存档  5,打工  "<<endl;
        cin>>a; 
        if(a==1){
            if(rs>=3){
                rs=rs-3;
                ls=ls+5;
            }
        }
        if(a==2){
            system("cls");
            cout<<"招几个,一人10元";
            cin>>c; 
            if(qs>=c*10){
                qs=qs-c*10;
                rs=rs+c;
            }
            else{
                cout<<"钱不够";
                cin>>c;
            }
        }
        if(a==3){
            if(ls>=rs){
                sxl=sxl-rs;
                ls=ls-rs;
            }
            else{
                cout<<"粮食不够";
                cin>>c;
            }
        }
        if(a==4){
            system("cls");
            cout<<"密码是704588"<<endl;
            cout<<"然后分别输出"<<sxl<<","<<djz<<","<<rs<<","<<qs<<","<<ls;
            cin>>c; 
        }
        if(a==5){
            qs=qs+djz+2;
        }
    }
    return 0;
}
 

标签:愚公移山,3C%,23%,代码,c++,20%,3B%,include,22%
来源: https://blog.csdn.net/t888ydro/article/details/120365820