fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main(void) {
  6. // your code goes here
  7. int a[50];//50個の乱数の配列
  8. int i, j, temp;
  9.  
  10. for(i = 0; i < 50; i++){
  11. a[i] = rand() % 100000000000000; //乱数を発生
  12. }
  13.  
  14. for(i = 0; i < 49; i++){ //バブルソート
  15. for(j = 0; j < 49 - i; j++){
  16. if(a[j] > a[j + 1]){
  17. temp = a[j];
  18. a[j] = a[j + 1];
  19. a[j + 1] = temp;
  20. }
  21.  
  22. }
  23. }
  24.  
  25.  
  26. int p;
  27. for(p = 0; p < 50; p++){
  28.  
  29. int n=a[p]; //p番目の要素が二桁になるまで10で割る
  30. while(n > 100){
  31. n/=10;
  32. }
  33. if (n==10){
  34. printf("%d\n",a[p]);
  35. }
  36.  
  37. }
  38.  
  39.  
  40. return 0;
  41. }
  42.  
  43.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
1025202362
1059961393