Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void ordenar(int b,int a[]){
- int aux;
- for(int i=0;i<b;i++){
- for(int j=0;j<b;j++){
- if(a[j]>a[j+1]){
- aux = a[j+1];
- a[j+1] = a[j];
- a[j] = aux;
- }
- }
- }
- }
- int main() {
- int t,n;
- cin>>t;
- int fuerza=0;
- for(int i=0;i<t;i++){
- cin>>n;
- int fi[n];
- for(int j=0;j<n;j++){
- cin>>fi[j];
- }
- ordenar(n,fi);
- for(int x=0;x<n;x++){
- if(fuerza<fi[x]){
- continue;
- }else fuerza++;;
- }
- cout<<fuerza<<endl;
- fuerza = 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement