Binary Course
77 subscribers
132 photos
19 videos
119 files
41 links
Reconfigurable Systems
Digital System Synthesis
Computer Aided Design
Embedded Systems
Computer Systems
HW-SW Co-design
Deep Learning
@BinaryCourse
Download Telegram
/* Binary Course (C) 2016
Problem 1
*/

#include <iostream>
#include <vector>

std::vector<int> l;

void loop(int s) {
if (s) {
for (int i = 1; i <= s; i++) {
l.push_back(i);
loop(s - i);
l.pop_back();
}
return;
}
for (int i = 0; i < l.size(); i++) std::cout « l[i] « " ";
std::cout « std::endl;
}

int main() {
int n;
std::cin » n;
loop(n);
}
/**
Binary Course (C) 2016
PROBLEM 2
*/

#include <iostream>

using std::cout;
using std::cin;
using std::endl;

long long int addition(long long int,long long int);

int main()
{
long long int x,y;
int sum;
while(1){
cin » x » y;
if(x==0 && y==0) break;
sum=addition(x,y);
if(sum<1){
cout«"\n\tNo Carry\n"«endl;
} else
cout«"\n\t"«sum«endl«endl;
}
return 0;
}

// Start Addition.
long long int addition(long long int x,long long int y)
{
int sum=0;
while(x || y){
if((x%10+y%10)>9) sum++;
x/=10;
y/=10;
}
return sum;
}
// End Addition.