codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <fstream> using namespace std; int main() { ifstream in; in.open("football.ppm"); ofstream out; out.open("football_noRed.ppm"); string header; int cols, rows, colors; int r, g, b; in >> header >> cols >> rows >> colors; out << header << endl; out << cols << " " << rows << endl; out << colors << endl; for (int i=0; i<rows; i++) { for (int j=0; j<cols; j++) { in >> r >> g >> b; r = 0; cout << r << " " << g << " "<< b << endl; } out << endl; } in.close(); return 0; }
Private
[
?
]
Run code
Submit