Cần giải thích đoạn if trong code in mảng theo thứ tự giảm dần

// in ra so tu lon den be
#include<stdio.h>
#include<conio.h>
int main() {
	int a,n[100],i,j,v;
	printf("nhap gia tri"); scanf("%d",&a);
	for (i=0;i<a;i++) scanf("%d",&n[i]);
	for (i=0;i<a-1;i++) 
	for(j=i+1;j<a;j++)
	{
		if (n[i]<n[j]) {
			v=n[i];
			n[i]=n[j];
			n[j]=v;
		}
	}
	for (j=0;j<a;j++) printf("%d ",n[j]);
}

đoạn n[j]=n[i]
rồi n[i]=n[j] ==> tráo đổi số cho nhau biết mỗi nhiêu đó
rồi printf ra n[j] là sao ấy nhỉ ^^

1 Like

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Thớt hỏi code C, bạn up code C++ vào làm gì?

83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?