Home > Back-end >  CSDN programming challenge question why challenge failure "watch the World Cup"
CSDN programming challenge question why challenge failure "watch the World Cup"

Time:10-05

Post code:

#include
#include

using namespace std;

Void func (string s, int m)
{
Int I, j, sum=0;
I=0;
For (j=s.s considering () - 1; J & gt;=0; J -)
{
If (' 0 '==s [j])//position no occupied
{
I=j, m;
While ((I & lt; 0 | | s [I]=='0') & amp; & i i++;
//cout & lt; <"I:" & lt; If (' 1 '==s [I])
{
S [j] [I]=s;
S [I]='0';
The sum + +;
}
//cout & lt; <"J:" & lt; }
//cout & lt; }
cout //cout & lt; }

Int main ()
{
String s;
Int m;
While (cin & gt;> S & gt;> M)
{
If (s.s considering () & gt; 148 | | m & lt; 1 | | m & gt; 10)
continue;
Func (s, m);
}
Return 0;
}
  • Related