文件名称:Assignment_1
介绍说明--下载内容均来自于网络,请自行研究使用
Exercise 1: cryptarithm_array.c (2.5 marks).
A cryptarithm is a puzzle where digits have to be assigned to the letters of some words, dierent
letters being assigned dierent digits, and no word starting with 0, such that a number of conditions
are satised, that are naturally related to the meanings of the words when the words do have a
meaning. The program sample_cryptarithm_array.c that comes with this assignment provides
you with an example of a cryptarithm, solved using an array-based technique, where the task is to
assign digits to the letters in three, four and eight, in such a way that:
none of the leading digits is 0
three is prime
four is a perfect square
eight is a perfect cube
It has a unique solution, namely, 42611 for three, 7056 for four, and 13824 for eight (so t is assigned
the digit 4, h is assigned the digit 2, etc.-Aims: The purpose of the assignment is to
let you design solutions to simple problems
let you implement these solutions in the form of short C programs
let you study existing code and take advantage of it to design solutions to your problems and
write your own code
practice the use of arithmetic computations, tests and repetitions
make use of arrays
make use of the internal representation of data
compare alternative approaches to a given problem.
A cryptarithm is a puzzle where digits have to be assigned to the letters of some words, dierent
letters being assigned dierent digits, and no word starting with 0, such that a number of conditions
are satised, that are naturally related to the meanings of the words when the words do have a
meaning. The program sample_cryptarithm_array.c that comes with this assignment provides
you with an example of a cryptarithm, solved using an array-based technique, where the task is to
assign digits to the letters in three, four and eight, in such a way that:
none of the leading digits is 0
three is prime
four is a perfect square
eight is a perfect cube
It has a unique solution, namely, 42611 for three, 7056 for four, and 13824 for eight (so t is assigned
the digit 4, h is assigned the digit 2, etc.-Aims: The purpose of the assignment is to
let you design solutions to simple problems
let you implement these solutions in the form of short C programs
let you study existing code and take advantage of it to design solutions to your problems and
write your own code
practice the use of arithmetic computations, tests and repetitions
make use of arrays
make use of the internal representation of data
compare alternative approaches to a given problem.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Assignment_1
............\ass1.files
............\..........\3285287.outputs.txt
............\..........\3285287.results.txt
............\..........\commands_and_expected_outputs.txt
............\..........\cryptarithm_array.c
............\..........\cryptarithm_bits.c
............\..........\division.c
............\..........\multiplication.c
............\assignment1.pdf
............\assignment_checklist.pdf
............\myassigment
............\...........\cryptarithm_array.c
............\...........\cryptarithm_array.c~
............\...........\cryptarithm_array.exe
............\...........\cryptarithm_array.o
............\...........\cryptarithm_bits (2).c
............\...........\cryptarithm_bits.c
............\...........\cryptarithm_bits.c~
............\...........\cryptarithm_bits.c~RF5260f5.TMP
............\...........\cryptarithm_bits.exe
............\...........\cryptarithm_bits.o
............\...........\cryptarithm_bits2.c
............\...........\cryptarithm_bits2.exe
............\...........\cryptarithm_bits2.o
............\...........\division.c
............\...........\division.c~
............\...........\division.exe
............\...........\division.o
............\...........\MFCB14C.tmp
............\...........\multiplication.c
............\...........\multiplication.c~
............\...........\multiplication.exe
............\...........\multiplication.o
............\myassigment.rar
............\sample_cryptarithm_array.c
............\sample_cryptarithm_bits.c
............\sample_multiplication.c
............\ass1.files
............\..........\3285287.outputs.txt
............\..........\3285287.results.txt
............\..........\commands_and_expected_outputs.txt
............\..........\cryptarithm_array.c
............\..........\cryptarithm_bits.c
............\..........\division.c
............\..........\multiplication.c
............\assignment1.pdf
............\assignment_checklist.pdf
............\myassigment
............\...........\cryptarithm_array.c
............\...........\cryptarithm_array.c~
............\...........\cryptarithm_array.exe
............\...........\cryptarithm_array.o
............\...........\cryptarithm_bits (2).c
............\...........\cryptarithm_bits.c
............\...........\cryptarithm_bits.c~
............\...........\cryptarithm_bits.c~RF5260f5.TMP
............\...........\cryptarithm_bits.exe
............\...........\cryptarithm_bits.o
............\...........\cryptarithm_bits2.c
............\...........\cryptarithm_bits2.exe
............\...........\cryptarithm_bits2.o
............\...........\division.c
............\...........\division.c~
............\...........\division.exe
............\...........\division.o
............\...........\MFCB14C.tmp
............\...........\multiplication.c
............\...........\multiplication.c~
............\...........\multiplication.exe
............\...........\multiplication.o
............\myassigment.rar
............\sample_cryptarithm_array.c
............\sample_cryptarithm_bits.c
............\sample_multiplication.c