Home > Back-end >  Bosses to solve, how to write???
Bosses to solve, how to write???

Time:06-10

CodePudding user response:

Define a character array, deposited in the array, you can do whatever you want

CodePudding user response:

Need not array can do?

CodePudding user response:

I can't do the array

CodePudding user response:

Circulation?

CodePudding user response:

Well, learn, learn cycle

CodePudding user response:

reference 5 floor weixin_45857580 reply:
well, learn, learn cycle

CSDN BBS newbie guide
 
#include
Int main (void) {
int n;
The scanf (" % d ", & amp; N);
int count=0;
While (n & gt; 0 {
++count;
N/a=10;
}
Printf (" % d \ n ", count);
return 0;
}

CodePudding user response:

Ask is, how to put the few together???????

CodePudding user response:

Turn int string of function call what name?

CodePudding user response:

Itoa atoi
These two functions, baidu once,

CodePudding user response:

` ` ` c
#include

Void how_many_digits (int number);
Void output_each_didhts (int number);
Void reversed_order (int number);

Int main ()
{
int num;
Printf (" both Please input your number: \ n ");
The scanf (" % d ", & amp; Num);

How_many_digits (num);

Printf (" \ nOutput each dight: \ n ");
Output_each_didhts (num);

Printf (" \ n \ nOut put the reversed order: \ n ");
Reversed_order (num);

return 0;
}

Void how_many_digits (int number)
//a integer digit
{
int count=0;
While (number>
=1){
Number/=10;
count++;
}
Printf (" % d \ n ", count);;
}


Void output_each_didhts (int number)
//by using recursive the number of each digital output (positive sequence)
{
Int r;
R=% number 10;
If (number & gt;=10)
Output_each_didhts (number/10);
Printf (" % d ", r);
}


Void reversed_order (int number)
//for a number of each digital reverse output
{
Int temp.
While (number & gt; 0)
{
Temp=% number 10;
Printf (" % d ", temp);
Number/=10;
}
}
` ` `

CodePudding user response:

 # include & lt; stdio.h> 
Int main (void)
{
Int n, I;
int count=0;
Int digit [10].

The scanf (" % d ", & amp; N);
While (n) {
Digit [count++]=n % 10;
//+ + count;
//printf (" % d ", n % 10);
N/a=10;
}
Printf (" % d \ n ", count);
For (I=count - 1; I & gt;=0; I -)
Printf (" % d ", digit [I]);

Putchar (10);
For (I=0; i Printf (" % d ", digit [I]);
Putchar (10);
return 0;
}

For your reference ~

CodePudding user response:


I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html
  • Related