-
I don't understand it, don't make it too complicated, it may be easy to use other methods, hehe, write one yourself, hope to refer to it.
#include
main()
void sixteen(int data);
int data;
scanf("%d",&data);
if(data>=0)
printf("0x");
sixteen(data);
elseprintf("1x");
sixteen(~data+1);
return 0;
void sixteen(int data)if(data<10)
printf("%d",data);
else if(data<=15)
printf("%c",data+87);
elsesixteen(data/16);
if(data%16<10)
printf("%d",data%16);
elseprintf("%c",data%16+87);
-
It's a bit complicated, there are existing functions, and you can put "%x" in the format output, such as printf("0x%x",255);
The output is 0xff
-
This must be an endless loop, don't look at anything else, just look at this sentence:
for (i=4;i>1;i++)
The initial value of i is 4, and the treatment after each cycle is i++ self-increasing treatment, and the cycle condition still requires i to be greater than 1, and it will definitely not meet the condition of loop exit, so it must be an endless loop.
-
for(i=0;j<4;i++,i++)for(k=1;k<3;k++)printf("*");
The result of the execution of the program segment is not to enter the loop, or to fall into an "endless loop" (depending on the initial value of j)If the initial value of j is not 0, it will fall into an "endless loop", and it will continue to output *If the initial value of j ==0, it will not enter the loop and there will be no output.
-
The first loop has no end condition and will continue to loop (dead loop), and the second loop has a semicolon after it, which is an empty loop, so the machine does nothing and just loops there empty.
If you make a mistake and one of the first for statements is J++, the program will only print a *, because you added a semicolon after the second for statement, and the printf statement is no longer part of the for loop, and is only executed once.
-
This is a piece of error** Almost none of the places are right Error 1: What is the initial value of j? Well, if there is an initial value of j that does not change, then the loop will either not be executed at all (j>4) or an infinite loop (j<4).
Mistake 2: You have two for the back is; That is, the loop is empty, which means that nothing is executed.
Okay, I'll let me be wrong, if you write one less j=0 where i++ is j++, then you're always going to end up with a * because the loop doesn't work at all.
-
The first loop assigns a to the array: the second loop assigns the value to the array p; In the third cycle, k is accumulated, the initial value of k is equal to 5, in the first cycle, k=k+p[0]*2=5+0*2=5, in the second cycle, k=k+p[1]*2= 5+2*2=9, in the third cycle, k=k+p[2]*2=9+6*2=21 and output.
-
#include
void main()
Nested loop statement, the result is 55
See for(j=i; j<=5;j++) when the outer loop i=1, j=i will calculate the value of 1+2+3+4+5.
i=2,3,4,5 and then calculate 2+3+4+5,3+4+5....
-
Hello, I haven't used it for a long time to assemble it, give you two subroutines, and combine it yourself(14) Designator: HASC Function: Convert single-byte hexadecimal numbers into double-byte ASCII codes.
Entry condition: The single-byte hexadecimal number to be converted is in accumulator a.
Export information: The ASCII code with the upper four digits is in A, and the ASCII code with the lower four digits is in B.
Impact Resources: PSW, A, B Stack Requirements: 4 bytes HASC: MOV B, A; Staging single-byte hexadecimal numbers to be converted lcall has1 ; Convert the lower four bits.
xch a,b ;Store the lower four digits of ASCII code swap A; Prepare to convert the top four bits.
has1: anl a,#0fh ;Convert the lower four bits of the accumulator into ASCII codes.
add a,#90h
da aaddc a,#40h
DA ARET(15) Designator: ASCH Function: ASCII code to hexadecimal number entry condition: The ASCII code to be converted (30h 39h or 41h 46h) is in A.
Export Information: The converted hexadecimal number (00h 0fh) is still in accumulator a.
Impact Resources: PSW, A Stack Requirements: 2 bytes.
asch: clr c
subb a,#30h
jnb ,ash1
subb a,#
ash1: ret
-
The requirements of the question are a bit vague.
Suggested take a look:
-
There is a mistake in your logic, the outer loop i=1, which causes the array subscript 0 not to participate in the sorting (but because the inner loop is also wrong, so it participates in the sorting again, but it is still wrong...). If you want to sort from largest to smallest, change it to the following:
Take out the values in the array one by one.
for(int i=0; i<; i++)
-
Upstairs is right, because your outer loop i and inner loop j are equal, so temp[i].
-
When i=0 j=0, temp[i] and temp[j] are not the same value. Because they are equal, the first comparison is invalid when i=j=0. After that, there is a time when i and j are equal, and both are invalid.
-
int i = 0 and int i = 1; There is no difference.
What changes is the size of the array.
There are more such projects, and the key depends on what resources, skills, and abilities you have, even if you are a beggar, you must also learn to be thick-skinned, find the right place, learn to be a dull hail, and do some things that must be done.
The down payment is generally okay, but it is more difficult to make 0 interest and 0 monthly payment. If you have 0 down payment, you can apply to the lending institution, wait for the application to pass the contract, and then pick up the car and repay the loan on time. >>>More
Profit and loss issues.
All are calculated according to the scheduled time. >>>More
The available balance of electricity bills is 0 and the amount in arrears is 0, which means that there are currently no unpaid electricity bills in your electricity account. If there is an overdue payment, the amount of the overdue payment is displayed. If your available balance is 0, you do not currently have any pre-deposits or balances in your electricity account. >>>More
It's a blue screen, right? There are many reasons for the blue screen: >>>More