Đảo mảng

#include<iostream> using namespace std; #include<stdio.h> int main() { int a[5]={1,2,3,4,5}; int i,j,c; for(i=0,j=4;i<j;i++,j--) { c=a[i]; a[i]=a[j]; a[j]=c; } cout<<"day so cu 1 2 3 4 5";cout<<"\n"; cout<<"day so moi:";cout<<"\n"; for(int i=0;i<5;++i) { cout<<a[i]; } }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.