我先写1个片段,谢谢。
#include <bits/stdc++.h>
#include <windows.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
using namespace std;
long double xy[50][50];
short xxyy[50][50];
short x,y,fx,fy,fsl,hl=0,zsl;
int money=100;
string yyn;
void ymap()
{
for(int i=1; i<=20; i++)
{
for(int j=1; j<=20; j++)
{
if(xxyy[i][j]==1)
{
cout<<"总"<<setw(2)<<setfill('0')<<xy[i][j]<<" ";
}
else if(xxyy[i][j]==2)
{
cout<<"分"<<setw(2)<<setfill('0')<<xy[i][j]<<" ";
xy[i][j]+=0.5;
}
else
{
cout<<"街 ";
}
}
cout<<'\n';
}
}
int main()
{
ymap();
return 0;
}
#include <bits/stdc++.h>
#include <windows.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
using namespace std;
long double xy[50][50];
short xxyy[50][50];
short x,y,fx,fy,fsl,hl=0,zsl;
int money=100;
string yyn;
void ymap()
{
for(int i=1; i<=20; i++)
{
for(int j=1; j<=20; j++)
{
if(xxyy[i][j]==1)
{
cout<<"总"<<setw(2)<<setfill('0')<<xy[i][j]<<" ";
}
else if(xxyy[i][j]==2)
{
cout<<"分"<<setw(2)<<setfill('0')<<xy[i][j]<<" ";
xy[i][j]+=0.5;
}
else
{
cout<<"街 ";
}
}
cout<<'\n';
}
}
int main()
{
ymap();
return 0;
}