33,311
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
typedef struct loc {
unsigned char a : 4;
unsigned char b : 4;
} X;
X i;
for (i.a = 1; i.a <= 9; ++i.a)
for (i.b = 1; i.b <= 9; ++i.b)
if (i.a % 3 != i.b % 3)
printf("A = %d, B = %d\n", i.a, i.b);
//std::cout << "x = " << i.a << ",y = " << i.b << std::endl;
return 0;
}
#include <iostream>
#include <stdio.h>
int main()
{
typedef struct loc
{
unsigned char a : 4;
unsigned char b : 4;
} X;
X i;
for (i.a = 1; i.a <= 9; ++i.a)
for (i.b = 1; i.b <= 9; ++i.b)
if (i.a % 3 != i.b % 3)
//printf("A = %d, B = %d\n", i.a, i.b);
std::cout << "x = " << (int)i.a << ",y = " << (int)i.b << std::endl;
return 0;
}