卫士通最新或2022(历届)笔试真题

时间:09-24编辑:佚名 招聘笔试题

【23xiu.com-爱上秀-教育信息门户网】

  20. return sign*n;

  21. }

  22.

  23. /*

  24. Converts an int or long into a character string

  25. 将一个整数转化为字符串

  26. */

  27. void my_itoa(int n,char s[])

  28. {

  29. int i,j,sign;

  30.

  31. if((sign=n)<0) //记录符号

  32. n=-n; //使n成为正数

  33. i=0;

  34. do{

  35. s[i++]=n%10+'0'; //取下一个数字

  36. }while((n/=10)>0); //循环相除

  37.

  38. if(sign<0)

  39. s[i++]='-';

  40. s[i]='\0';

  41. for(j=i-1;j>=0;j--) //生成的数字是逆序的,所以要逆序输出

  42. printf("%c",s[j]);

  43. }

  44.

  45.

  46. void main()

  47. {

  48. int n;

  49. char str[100];

  50. my_itoa(-123,str);

  51. printf("\n");

  52. printf("%d\n",my_atoi("123"));

  53. system("pause");

  54. }

  四、问答

  1.你对卫士通的了解?

  2.说出你胜任这份工作的理由?

1234
【猜你喜欢】 【为你推荐】