笔试题:Suggest a simple and fast way to multiply the input integer digit by 7。
2014-12-22 14:05
344 查看
翻译:不使用乘法运算,使用简单且快捷的方式实现输入的数字乘以7。
解决方案:
运行效果:
解决方案:
#include "stdio.h" int main(int argc, char **argv ) { int a; printf("Please Input Your Number:\n"); scanf("%d", &a); printf("Before Multiplying, the number is:%d\n", a); int b=( (a<<3)-a ); printf("Caculation Results is:%d.\n", b); }
运行效果:
相关文章推荐
- Simple and easiest way to make a screen shot in .net 2.0
- A step-by-step guide to the use of the Intel OpenCV library and the Microsoft DirectShow technology
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]
- The Old Man and The Sea 老人与海 by Ernest Hemingway 欧内斯特-海明威
- 翻译 Scribe : a way to aggregate data and why not, to directly fill the HDFS?
- A Simple Way to Enable a Windows XP Look and Feel for VC++ 6.0 MFC Applications
- When the RTP port is set to 8005, why is 8006 used by RTP and 8007 for RTCP for all communications ?
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]
- The best way to convert and burn videos to dvd
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]
- On the Way to the Web: The Secret History of the Internet and Its Founders
- A way to control the width of columns and bars (RDL)
- An introduction to the Java 2 Platform, Enterprise Edition specification by way of BEA's WebLogic Server
- XDB: Utility package to change the HTTP and FTP ports used by XML DB
- XDB: Utility package to change the HTTP and FTP ports used by XML DB.
- a simple and easy way to export grid(grid view) to excel
- The basic way to support both ASCII and Unicode:
- How to write an application that supports the Fast User Switching feature by using Visual Basic .NET or Visual Basic
- How to Change the DBID and the DBNAME by using NID
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]