石小疯 发表于 2022-11-18 20:32:21

计算机等级考试二级C语言程序设计专项训练题——程序设计题(五)

36、编写函数void  fun (int *a, int *n),其功能是:求出100~999之间所有个位数字与十位数字之和被10除所得余数恰是百位数字的素数(如293),并将其放在a所指的数组中,通过n返回这些数的个数。
#include <stdio.h>
voidfun (int *a, int *n)
{
}
int main()
{
    int aa, n, k ;
    fun (aa, &n ) ;
    for ( k = 0 ; k < n ; k++ )
    {
      printf("%5d", aa) ;
      if ((k + 1) % 10 == 0) printf("\n") ;
    }
    return 0;
}https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gifhttps://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gifvoidfun (int *a, int *n){    int i,j,bw,sw,gw,cnt=0;    for (i=101;i
页: [1]
查看完整版本: 计算机等级考试二级C语言程序设计专项训练题——程序设计题(五)