fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[]={3,5,2,4,1,9,7,6,0,8};
  5. int i,temp;
  6. printf("初期状態");
  7. for(i=0;i<10;i++){
  8. printf("%d",a[i]);
  9. }
  10. temp=a[0]; a[0]=a[3]; a[3]=temp;
  11. temp=a[3]; a[3]=a[5]; a[5]=temp;
  12. temp=a[5]; a[5]=a[8]; a[8]=temp;
  13. printf("入れ替え後");
  14. for(i=0;i<10;i++){
  15. printf("%d",a[i]);
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5308KB
stdin
Standard input is empty
stdout
初期状態3524197608入れ替え後4529107638