| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2615 人关注过本帖
标题:公司给的几道C语言方面的题目
取消只看楼主 加入收藏
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 
mp3aaa 朋友:
16--10
8--10也是类似
#include<stdio.h>
#include<math.h>
main()
{
char a[10];
long k=0,i,j=0,x,y;
scanf("%s",a);
i=strlen(a)-1;
while(i+1)
{ x=long(pow(16.0,j++)); //我运行的时候怎么这里老是报错的...................
y=a[i]>='0'&&a[i]<='9'?a[i--]-'0':a[i--]-'A'+10;
k+=x*y;
printf("%d,%d\n",x,y);我测试数据时用的
}
printf("%ld",k);
}

2007-07-03 19:10
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

呵呵,果然不错!!
能能给别的题目也看看.......谢谢...........

2007-07-03 23:09
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

怎么没人给俺看看了啊................

2007-07-04 09:32
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

呵呵,谢谢了.....

2007-07-04 11:20
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

QUESTION #3

1. Considering compacting memory while managing equal-sized blocks. Assume each block consists of a data field and a pointer field, and that we have marked every block currently in use. The blocks are currently located between memory locations a and b. We wish to relocate all active blocks so that they occupy contiguous memory starting at a. In relocating a block remember that the pointer field of any block pointing to the relocated block must be updated. Design an optimized C program for compacting the blocks.

QUESTION #4

1. Write a program in C to multiply two linear matrices. This program should take as input the dimensions of each matrix, as well as the components of each matrix. Remember to write the most optimal code possible. Use the following matrices as a test:

1 0

-2 3 0 6 1

5 4 3 8 -2

0 1



有会的帮忙看下,多谢!!!!!!!!!!!!

2007-07-05 21:55
andygao818
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2006-12-19
收藏
得分:0 

谢谢楼上的各位........学到不少东西..........
难道这到题目就没有人会做吗??


QUESTION #4

1. Write a program in C to multiply two linear matrices. This program should take as input the dimensions of each matrix, as well as the components of each matrix. Remember to write the most optimal code possible. Use the following matrices as a test:

1 0

-2 3 0 6 1

5 4 3 8 -2

0 1

2007-07-07 12:05
快速回复:公司给的几道C语言方面的题目
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021842 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved