在这段代码中,符号的作用是%3d什么?我知道%表示引用变量.
这是代码:
#include <stdio.h>
int main(void)
{
int t, i, num[3][4];
for(t=0; t<3; ++t)
for(i=0; i<4; ++i)
num[t][i] = (t*4)+i+1;
/* now print them out */
for(t=0; t<3; ++t) {
for(i=0; i<4; ++i)
printf("%3d ", num[t][i]);
printf("\n");
}
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我尝试找到一个问题的解决方案....我们有一个数字,例如:20 ...我们有6个数字:{a,b,c,d,e,f} <20,t试图找到这些数字的所有值,但前提是我们可以组合(whit +或 - )whit这个数字并将所有值低于20:例如
我们选择31:
a = 22 b = 21 c = 14 d = 11 e = 9 f = 5
我们有:22 - 21 = 1; 11 - 9 = 2; 14 - 11 = 3; 9 - 5 = 4; f = 5; 11 - 5 = 6; 21 - 14 = 7; .... .... .... .... 21 + 9 = 30; 9 + 22 = 31;