文件名称:find-sum
- 所属分类:
- 行业发展研究
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2015-02-04
- 文件大小:
- 23kb
- 下载次数:
- 0次
- 提 供 者:
- shruti*******
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
1. Find Sum.
Given a set of n integers (in sorted order) and another integer x.
The algorithm has been designed that verifies whether there exist pairs of integers a and b such that
a + b = x,
Algorithm should output all such pair of integers.
our program takes as input a sequence of numbers in sorted order (in first line), the integer x (in second line) and outputs the resulting pairs as a,b (each pair on a separate line).
Note: Order of occurrence in output file among these resulting pairs should be maintained.
eg.
Input file (input.txt)
15 19 20 23 27 31 40 45
60
Output file (output.txt)
15,45
20,40
It assumes that our program is compiled into findSum.out executable and takes input.txt file as input and output.txt file as output.
./findSum.out input.txt output.txt-1. Find Sum.
Given a set of n integers (in sorted order) and another integer x.
The algorithm has been designed that verifies whether there exist pairs of integers a and b such that
a + b = x,
Algorithm should output all such pair of integers.
our program takes as input a sequence of numbers in sorted order (in first line), the integer x (in second line) and outputs the resulting pairs as a,b (each pair on a separate line).
Note: Order of occurrence in output file among these resulting pairs should be maintained.
eg.
Input file (input.txt)
15 19 20 23 27 31 40 45
60
Output file (output.txt)
15,45
20,40
It assumes that our program is compiled into findSum.out executable and takes input.txt file as input and output.txt file as output.
./findSum.out input.txt output.txt
Given a set of n integers (in sorted order) and another integer x.
The algorithm has been designed that verifies whether there exist pairs of integers a and b such that
a + b = x,
Algorithm should output all such pair of integers.
our program takes as input a sequence of numbers in sorted order (in first line), the integer x (in second line) and outputs the resulting pairs as a,b (each pair on a separate line).
Note: Order of occurrence in output file among these resulting pairs should be maintained.
eg.
Input file (input.txt)
15 19 20 23 27 31 40 45
60
Output file (output.txt)
15,45
20,40
It assumes that our program is compiled into findSum.out executable and takes input.txt file as input and output.txt file as output.
./findSum.out input.txt output.txt-1. Find Sum.
Given a set of n integers (in sorted order) and another integer x.
The algorithm has been designed that verifies whether there exist pairs of integers a and b such that
a + b = x,
Algorithm should output all such pair of integers.
our program takes as input a sequence of numbers in sorted order (in first line), the integer x (in second line) and outputs the resulting pairs as a,b (each pair on a separate line).
Note: Order of occurrence in output file among these resulting pairs should be maintained.
eg.
Input file (input.txt)
15 19 20 23 27 31 40 45
60
Output file (output.txt)
15,45
20,40
It assumes that our program is compiled into findSum.out executable and takes input.txt file as input and output.txt file as output.
./findSum.out input.txt output.txt
(系统自动生成,下载前可以参看下载内容)
下载文件列表
find sum\assignmentada2.docx
........\q1 findsum.docx
........\q1.cpp
find sum