You are not logged in. Please login at to post your questions!


Attached code seems to be working fine but not accepted for A game of shadows-ROBOGAME!!



using namespace std; int main() { int n,i,j,c,a1,a2; cin>>n; string s; for(i=0;i<n;i++) {="" c="0;" cin="">>s; j=0; while( s[j]=='.') j++; while( s[j]!='\0') {a1=s[j]; j++; while( s[j]=='.') {j++; c++;} a2=s[j]; if(c<a2+a1-96) {cout<<"unsafe\n"; break;} } if(s[j]=='\0') cout<<"safe\n"; } return 0; }

asked 16 Dec '18, 19:22

djthecoder's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 16 Dec '18, 19:22

question was seen: 35 times

last updated: 16 Dec '18, 19:22