Ejemplo n.º 1
0
int main()
{
	int s;
	char num[10];
	char a[11]="- -- -----";
	char b[2][11];
	char c[11]="  ----- --";
	char d[2][11];
	char e[11]="- -- -- --";
	strcpy(b[0],"|   ||| ||");
	strcpy(b[1],"|||||  |||");
	strcpy(d[0],"| |   | | ");
	strcpy(d[1],"|| |||||||");

	while(scanf("%d %s",&s,num),s){
		printrow(a,s,num);
		printf("\n");
		printcol(b,s,num);
		printrow(c,s,num);
		printf("\n");
		printcol(d,s,num);
		printrow(e,s,num);
		
		printf("\n\n");
	}


	return 0;
}
Ejemplo n.º 2
0
int main()
{
	list *head=readfromfile();
	rebuild(head);//排序重建
	int num;
	printf("演示————\n\n输入查找的列:");
	fflush(stdin);
	scanf("%d",&num);
	printcol(head,num);

	printf("\n\n输入查找的行:");
	fflush(stdin);
	scanf("%d",&num);
	printrow(head,num);
	int x,y;
	printf("\n\n输入查找的坐标(x y):");
	fflush(stdin);
	scanf("%d%d",&x,&y);
	printone(head,x,y);
	char name[20]="";
	printf("\n\n输入查找的人名:");
	fflush(stdin);
	scanf("%s",name);
	printaperson(head,name);
	//查找就那么遍历链表就行了,没写。
	
	printsitchart(head);
	return 0;
}
Ejemplo n.º 3
0
void render2d(alls *all) {
  double r_A = all->p.p_A - all->s.p_FOV / 2;
  int i;
  for (i = 0; i < all->rn.cols; ++i) {
    printcol(all, i, (int)(\
    p_raylen(all, r_A) == -1 ? 0 : \
    (p_raylen(all, r_A) < 1 ? all->rn.rows : all->rn.rows / p_raylen(all, r_A))));
    r_A += all->s.p_FOV / all->rn.cols;
  }
}
Ejemplo n.º 4
0
    virtual void update(double time,
	                    uint32_t* out,
                        const uint32_t* in)
    {
        std::copy(in, in + width*height, out);


        ABGR col;
        col.r = 255*m_color.r;
        col.g = 255*m_color.g;
        col.b = 255*m_color.b;
        col.a = 255;

        float yt = y0 - (1-m_time)*H;
        ABGR *outAsABGR = (ABGR*) out;

#ifdef DEBUG
#define printcol(x) std::cout << #x ": [ " << (int) x.r << " | " << (int) x.g << " | " << (int) x.b << " ]" << std::endl;

        std::cout << "r = " << m_color.r << ", g = " << m_color.g << std::endl;
        ABGR blended = col.blend(outAsABGR[0], .5);
        printcol(col);
        printcol(outAsABGR[0]);
        printcol(blended);
#undef printcol
#endif


        for (int y = y0; y > int(yt); y--) {

            float factor = 1-m_transparency;
            if (y == int(yt)) {
                factor *= 1 - (yt-int(yt));
            }

            for (int x = x0; x < x0+W; x++) {

                outAsABGR[width*y + x] = col.blend(outAsABGR[width*y + x], factor);
            }
        }

    }
Ejemplo n.º 5
0
void setrightcol(void)
/* Sets the value of rightcol based on the value of leftcol */
{
 int total = LEFTMARGIN, col = 0;

 do
 {
  colstart[col] = total;
  total += colwidth[leftcol + col++];
 }
 while ((total <= 80) && (leftcol + col <= MAXCOLS));
 rightcol = leftcol + col - 2;
 printcol();
} /* setrightcol */
Ejemplo n.º 6
0
int main(void) {
        scanf("%d", &T);
        while(T--) {
                scanf("%s", line);
                if(sscanf(line,"R%dC%d", &r, &c) == 2) {
                        printcol(c);
                        printf("%d\n", r);
                } else {
                        sscanf(line, "%[A-Z]%d", t, &r);
                        for(p = t, c = 0; *p; p++) c = c * 26, c += *p - 'A' + 1;
                        printf("R%dC%d\n", r, c);
                }
        }
        return 0;
}
Ejemplo n.º 7
0
void cprint(termcolor col,gint verbosity, GlyrQuery * s, const char * fmt, ...)
{
    if((s && verbosity <= s->verbosity) || verbosity == -1)
    {
        if(col != DEFAULT && global_enable_color)
            printcol(GLYR_OUTPUT,col);

        va_list param;
        va_start(param,fmt);
        g_logv("Glyrc",G_LOG_LEVEL_INFO,fmt,param);
        va_end(param);

        if(col != DEFAULT && global_enable_color)
            resetcolor(GLYR_OUTPUT);
    }
}
Ejemplo n.º 8
0
void setleftcol(void)
/* Sets the value of leftcol based on the value of rightcol */
{
 int total = 80, col = 0;

 while ((total >= LEFTMARGIN) && (rightcol - col >= 0))
 {
  colstart[SCREENCOLS - col - 1] = total - colwidth[rightcol - col];
  total -= colwidth[rightcol - col++];
 }
 if (total >= LEFTMARGIN)
  col++;
 movmem(&colstart[SCREENCOLS - col + 1], colstart, col - 1);
 leftcol = rightcol - col + 2;
 total = colstart[0] - LEFTMARGIN;
 if (total != 0)
 {
  for (col = leftcol; col <= rightcol; col++)
   colstart[col - leftcol] -= total;
 }
 printcol();
} /* setleftcol */
Ejemplo n.º 9
0
void printcol(int c) {
        if(!c) return;
        printcol((c - 1)/26);
        putchar(((c - 1)% 26) + 'A');
}