夜里边切题边等电影缓冲真是太爽了..
正在慢慢的切某人切不下来的题..
1573挺简单的 以后这种模拟的数组我都从1开始就好了..省得墨迹墨迹的整的头大..
主要就是想到一个监视指针的方法..做个tester指针数组 对应map上面所有的单元
这样本来看不懂的指针地址(0x22fb18这样)就能通过查找tester来获得它的位置(tester是一个地址的数组 找到对应的 然后数数)
详见下图 ap是tester,p==0x22fb18,在ap中排第10个,则p==*(ap[9])
[c]
#include <cstdio>
#include <cstring>
typedef struct spot {
char c;
bool b;
int n;
} Spot;
Spot *p;
void move() {
switch(p->c) {
case ‘N’:
p-=12;
break;
case ‘S’:
p+=12;
break;
case ‘E’:
p+=1;
break;
case ‘W’:
p-=1;
}
}
int main() {
int i,enter,j,n,rows,cols;
Spot a[12][12];
/*Tester
Spot *(ap[3][6]);
for(i=0;i<3;i++)
for(j=0;j<7;j++)
ap[i][j]=a[i]+j;*/
while(1) {
for(i=0;i<144;i++) {
((Spot *)a+i)->c=-1;
(a[0]+i)->b=false;
}
n=0;
scanf("%d%d%d",&rows,&cols,&enter);
if(!rows&&!cols&&!enter)
return 0;
getchar();
for(i=1;i<=rows;i++) {
for(j=1;j<=cols;j++)
a[i][j].c=getchar();
getchar();
}
p=a[1]+enter;
/* TESTER
for(i=0;i<rows;i++) {
for(j=1;j<=cols;j++)
printf("%c",a[i][j].c);
printf("\n");
} */
while(1) {
p->b=true;
p->n=n;
if(p->c==-1) {
printf("%d step(s) to exit\n",n);
break;
}
move();
if(p->b) {
printf("%d step(s) before a loop of %d step(s)\n",p->n,n+1-p->n);
break;
}
n++;
}
}
return 0;
}[/c]
References:
Lollybet Erfahrungen http://sculptandpaint.com/proxy.php?link=https://innvo.pro/fideliapor
References:
Lollybet Free Spins https://abonents-ntvplus.ru/
References:
Lollybet Casino Erfahrungen http://yami2.xii.jp/link.cgi?https://innvo.pro/elizabethj
References:
Lollybet Casino Auszahlungsdauer maps.google.com.ag
References:
Lollybet Casino PayPal https://livedudes.chaturbate.com:443/external_link/?url=https://getshort.in/harrietwienhol
References:
Lollybet Casino mit Echtgeld szsa.ru
References:
Lollybet Bonus Code cse.google.tn
References:
Lollybet Casino Verifizierung https://forum.hiasm.com/redirect/?url=https://gmaweb.online/santomichels73
References:
Lollybet Bonus ohne Einzahlung https://wiki.computacaonaescola.ufsc.br/
References:
Lollybet Casino Kundenservice google.mu
References:
Lollybet Casino Spielautomaten https://pagekite.net/
References:
Lollybet Startguthaben https://www.thisisant.com
References:
Lollybet Casino Erfahrungen https://www.hcsparta.cz/
References:
Lollybet Casino Einzahlung https://ogrish.chaturbate.com
References:
Lollybet Casino Slots https://avtobaza2.ru/bitrix/rk.php?goto=https://fhoz.shop/jinathompson86
References:
Lollybet Test k-texnik.ru
References:
Lollybet Casino Bonus ohne Einzahlung http://toolbarqueries.google.mn
References:
Lollybet Mobile Casino http://krug-shar.ru/
References:
Lollybet App http://medopttorg.ru/bitrix/rk.php?goto=https://searl.co/stephanialefan
References:
Lollybet legal http://cse.google.hn/url?sa=i&url=https://shorturls.zip/shennacode5144
References:
Lollybet Casino Mindesteinzahlung http://www.google.nl/url?q=https://tothemoon.id/angelitalabour
References:
Lollybet Casino Bonusbedingungen https://clients1.google.cat/
References:
Cosmopolitan casino vieclambinhduong.info
References:
Roulette layout nodam.kr
References:
Online casino reviews 1 site for best online casinos https://links.gtanet.com.br/stevepawsey
References:
Hollywood casino florida https://vieclambinhduong.info/employer/schnell-spielen-ohne-download/
References:
Blackjack promotions login https://academy.tatiosa.com/forums/users/antoinettepettey/
References:
Konami slot machines https://jobs-max.com/employer/online-casino-auszahlung-%e1%90%85-casinos-mit-schneller-auszahlung-top10/
References:
Windmill casino https://worlancer.com/profile/deenatownson38
References:
Blackjack rules chart https://afghanglobalconnect.com/groups/instant-casino-%e1%90%88-seriose-online-spielothek-mit-echtgeldspielen/