題目:
將一個數組從主函數中傳到自定義函數中函數裏面的值是否會改變
#include <stdio.h>
void shu(int i,int j)
{
int c=0;
for(;i<=j;i++)
{
printf("%d ",i);
c++;
if(c%5==0)
printf("\n");
}
}
int main()
{
int a,b;
scanf("%d,%d",&a,&b);
shu(a,b);
}
題目:
將一個數組從主函數中傳到自定義函數中函數裏面的值是否會改變
#include <stdio.h>
void shu(int i,int j)
{
int c=0;
for(;i<=j;i++)
{
printf("%d ",i);
c++;
if(c%5==0)
printf("\n");
}
}
int main()
{
int a,b;
scanf("%d,%d",&a,&b);
shu(a,b);
}