fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdbool.h>
  4.  
  5. int main() {
  6. int j = 0;
  7. int i = 0;
  8. int n = 0;
  9. int m = 0;
  10. int iCoachPerSim = 0;
  11. int iRemainder = 0;
  12. int iLocalIndex = 0;
  13. int iOutSimCardDetrm[24];
  14.  
  15. int iConsistTotalNumber=1, iSimCardCount=1, iLocalPosition=1;
  16. int abFactoryType[24]={1};
  17. int aiSimCardCoach[24]={1};
  18.  
  19. int iSimCardSendData;
  20. bool xEnaSendData;
  21.  
  22. if (iSimCardCount == 0) {
  23. iSimCardSendData = 0;
  24. xEnaSendData = 0;
  25. return 0;
  26. } else {
  27. iCoachPerSim = (iConsistTotalNumber)/(iSimCardCount);
  28. iRemainder = (iConsistTotalNumber)%(iSimCardCount);
  29.  
  30. for ( i = 0; i < 24; ) {
  31. if(iRemainder == 0) {
  32. for ( j = 0; j < iCoachPerSim; j++) {
  33. if((abFactoryType[i]) == 4) {
  34. iOutSimCardDetrm[i] = 0;
  35. j--;
  36. } else {
  37. iOutSimCardDetrm[i] = (aiSimCardCoach[n]);
  38. }
  39. i++;
  40. }
  41. n++;
  42. } else {
  43. for ( j = 0; j <= iCoachPerSim; j++) {
  44. if((abFactoryType[i]) == 4) {
  45. iOutSimCardDetrm[i] = 0;
  46. j--;
  47. } else {
  48. iOutSimCardDetrm[i] = (aiSimCardCoach[n]);
  49. }
  50. i++;
  51. }
  52. n++;
  53. iRemainder--;
  54. }
  55. }
  56. iLocalIndex = (iLocalPosition);
  57. for ( m = 0; m < 24; m++ ) {
  58. if( iLocalIndex == iOutSimCardDetrm[m]) {
  59. iSimCardSendData = 0;
  60. xEnaSendData = 0;
  61. return 0;
  62. }
  63. }
  64.  
  65. iSimCardSendData = iOutSimCardDetrm[iLocalIndex];
  66. xEnaSendData = 1;
  67.  
  68. }
  69. }
  70.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Standard output is empty