Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
84727 刘泽熙 打印每一趟冒泡排序 C++ Compile Error 0 MS 0 KB 507 2024-07-16 11:41:52

Tests(0/0):


Code:

#include<iostream> using namespace std; int a[20001]; int main(){ int arr=0,t=0; int n; cin>>n; for(int h=0;h<a;h++){ cin>>a[h]; } for(int i=0;i<n;i++){ for(int j=0;j<n-i-1){ if(a[j]<a[j-1]){ t=a[j]; a[j]=a[j+1]; a[j-1]=t; } for(int g=0;g<n;g++){ cout<<a[g]; } } } for(int k=0;k<n;k++){ cout<<a[k]; } }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     for(int h=0;h